Chapter 3. Vector spaces
§3.1 Definition and examples of a vector space
We’ll start with the following definition, which is actually a white lie.
Definition 3.1 (Vector space, provisional). A (real) vector space is any set obeying the following two requirements:
- Addition axiom: If and are in , so is .
- Scaling axiom: If is in and is a real number, then is in .
The elements of are then referred to as “vectors”.
I say this is a white lie because I haven’t actually defined “addition” or “scaling” yet. I will do this in Section 4.1 (and you may skip ahead to there if you like). However, practically speaking in every example of a vector space we encounter, it will be obvious what addition or scaling are intended to be.
In contrast, we do not talk about multiplying two vectors yet. That is, at present, we only allow scaling vectors by real numbers. Until then, any expression like or will always be considered a type error.
The first time we allow any sort of “product” is the wedge products, defined in Chapter 6. Later on in Phase V we then define a “dot product”.
This means that any kind of collection where the two rules above are satisfied qualifies as a vector space. This is an intentionally wide net. In textbooks written by sane people, vector spaces are often restricted to or its subspaces, in order to make things more concrete for beginners. But that won’t be good enough for us: for example, Chapter 6 won’t be possible to do restricted to a subspace of .
Here is one example to start:
My favorite example of a vector space is the set of polynomials of degree at most two in a variable , namely
That is, in this example, the word “vector” refers to such a polynomial, like or or or , and the “vector space” is the set of all such vectors.
For this example , we can check the two axioms in the definition above are satisfied:
When you add two polynomials in , you get another polynomial in : for example if and , then
is also an element of .
When you scale a polynomial in by a real number, you get another polynomial in : for example if and , then
is also an element of .
From the way is written, you probably already have a hunch this vector space has “dimension ”, in the sense “it takes three real numbers to specify an element of ”. That’s right. In general, the correct instinct is “the dimension the number of real parameters”. By the end of this chapter, we’ll make this into a real definition.
Exercise 3.2. In the quadratic polynomial example, I was careful to say “degree at most ” instead of “degree ”. Indeed, the set
fails both axioms in our definition. Give a counterexample for each axiom.
Like in the previous example, we’ll mention what the dimension of each example turns out to be, to test your instincts (even though we haven’t defined dimension officially yet).
- The complex numbers are a two-dimensional vector space too. (The sum of two complex numbers is a complex number; scaling a complex number by a real number gives a complex number.)
- The real numbers form a vector space of dimension .
Three-dimensional Euclidean space , defined by
forms a -dimensional vector space. In case you haven’t seen this before, the addition and scaling are done componentwise:
More generally, -dimensional Euclidean space defined by
forms an -dimensional vector space, under componentwise addition and scaling.
One important further example is
which is the set of triples of real numbers such that . For example, is a vector in , as is , as is the sum
There are a few equivalent ways to write , such as (among others):
However, all of them have the property that there are two variables. So we ought to suspect , and again, at the end of this chapter, we’ll prove it.
Exercise 3.4. Consider instead the set
This set fails both requirements to be a vector space. Find a counterexample for each.
Here are some examples that can be said to be infinite-dimensional. (However, this book will mostly focus on finite-dimensional vector spaces.)
The set of all polynomials with real coefficients is a vector space. (The standard notation for this space is , rather than .)
The set of all functions is also a vector space.
The set of all continuous functions is also a vector space.
The set of all differentiable functions is also a vector space.
§3.2 The definition of basis
Our first goal will be to make precise an official definition of “dimension”. To do this we need to introduce the notion of a basis.
Let’s go back to the favorite example
The basic idea is that we “ has as a basis”. And we can quickly write a definition that makes this precise.
Definition 3.5 (Linear combination). Suppose is a finite set of vectors. A linear combination of some vectors is a sum of the form
where . The linear combination is called trivial if , and nontrivial otherwise.
Colloquially, the way you should think of this in your head is:
Some complications arise if is infinite. We defer that discussion to Section 4.2.
Let’s give a few examples.
For , the set forms a basis of by definition.
For the standard basis vectors and are a basis. Indeed, given any , the unique combination is
For , the standard basis vectors , …, (defined in Section 2.4) are a basis.
The most interesting example we’ve encountered is the plane
Here, it is not immediately obvious what the basis should be. If one adopts
then one example of a basis would be the two vectors and .
Exercise 3.7. In the last example, convince yourself that and do form a basis for the plane .
Then, give a different example of a basis that looks as different as possible.
There is a second way to define a basis. Recall that in the definition we just gave, we want every vector to be represented as a linear combination in exactly one way. That’s a strong requirement, and when trying to work with proofs, it will often be easier to take it in two halves: “exactly one way” = “at least one way (existence)” + “at most one way (uniqueness)”. There are words corresponding to each of these two halves.
Definition 3.8 (Linear independence and spanning). Let , …, be elements of a vector space .
It is called spanning if every can be written as a linear combination of the .
It is called linearly independent if there is no nontrivial linear combination with value . (Observe that is always true — the assertion is that there is no other way to express in this form.)
To reiterate, you should internalize this as: = +
§3.3 The many possible bases of each vector space
For this discussion let’s specialize to . We know of course that and form a standard basis. However, what I want to convince you now is that this choice of standard basis is mostly convenient but otherwise not special. In fact, I claim that if I pull two random vectors in out of a hat, they’re almost certainly going to form a basis.
So for this narrative, let’s consider and . I want to convince you this is a basis. Let’s walk through this with some numbers first:
Exercise 3.10.
Let’s pick another random vector in like . Prove that there exists a unique pair of real numbers such that
Redo the previous part with and replaced by two variables and . That is, given two real numbers and , prove that there exists a unique pair of real numbers for that satisfying
Conclude that and are a basis of .
We could also replace , , , with four variables, to get a six-variable algebra calculation. Although this exercise is starred, it requires only careful bookkeeping. As long as you aren’t afraid of six variables, there’s no “trick” to it. From start to finish, there is only thing you can do.
Exercise 3.11 (*). Let , , , be real numbers. Prove that and form a basis of if and only if
Do so directly from the definition of basis, without quoting any results from later on.
So in fact for we know how to describe exactly what the possible bases are? Unless… why did we only look at the case of two elements?
§3.4 Dimension
Well, if you have common sense, you might have instinctively known this without even realizing it. There’s no way a single vector could span , and three vectors is too many: you’d never satisfy linear independence.
The general phenomenon is true: any two bases have the same number of elements. And we can already prove this, and more.
Theorem 3.13 (Steinitz exchange lemma). Let be a vector space. Suppose that
- , …, is a spanning set;
- , …, is a linearly independent set.
Then .
That means spanning sets are always at least as large as linearly independent sets.
Proof. The overall strategy is to start with the original spanning set of vectors, then do replacements. In the th step, we replace one of the with a while ensuring that the resulting vectors are still spanning. If we can do this times, we’re guaranteed that , because every is replacing a different .
Here are the details.
Let be the initial spanning set. Throw in : by the spanning condition, . There’s some nonzero coefficient; let’s suppose it’s . Thus
Thus is spanning too, completing the first step.
For the second step, we do the same thing again: throw in , deleting some (other) . This gives a new set ; we then repeat to get , , …, . The condition that the are linearly independent ensures that some coefficient must always not be zero.
The total number of vectors in the set never changes, so is still a set of vectors. But it contains every now, all of them, so .
Here are some specific exercises/examples that can help you digest the above proof.
From this we can conclude:
We can thus finally define “dimension”.
Remark 3.16 (We agree -dimensional means only the zero vector). The case can be confusing if you’re too pedantic, so let’s just agree on the following conventions:
- We always require vector spaces to have at least one vector (denoted ), no matter what.
- A space is zero-dimensional if and only if is the only vector in , i.e. has no nonzero vectors in it.
- In that case the basis of is the empty set.
§3.5 The 50%-off proposition if you know the dimension
If you did Exercise 3.11, you had to work pretty hard to verify an intuitive fact. However, now that we have the concept of dimension, we can state some convenience propositions that make Exercise 3.11 much easier. For example, if you’re trying to prove something is a basis, and you already know the dimension of the space, then Proposition 3.17 lets you skip half of the work: you only have to prove one of the two requirements in Proposition 3.9.
Proposition 3.17 (50% off all bases if you know the dimension). Let be an -dimensional vector space.
- If , …, are spanning, they they form a basis.
- If , …, are linearly independent, they they form a basis.
This makes Exercise 3.11 much easier.
Solution to Exercise 3.11 using Proposition 3.17. Note that:
- is a -dimensional vector space, because and form a basis.
- Hence by Proposition 3.17, and are a basis if and only if they are linearly independent; the “spanning” condition comes for free now.
When would and not be linearly independent? Well, a dependence is equivalent to saying there are constants and , not both zero, such that
- This is equivalent to and being multiples of each other.
- and are multiples of each other if and only if we have a common ratio . (We have to be a little careful here about division by zero.) This is equivalent to .
Hence, the proof is complete.
Here’s some practice with the plane from before:
Exercise 3.18. Show that and form a basis of the plane
§3.6 Recap
§3.7 Exercises
Exercise 3.19. Recall is the vector space of real polynomials of degree at most . Decide whether each of the following sets is a basis of or not:
- , , and .
- , , and .
- , , and .
- , , and .
Exercise 3.20. Show that the following four vectors form a basis of :
Exercise 3.22. Define
Show that forms a vector space, and calculate its dimension.
Exercise 3.23. Let be a vector space and take . Prove that the following statements are equivalent:
- The form a basis.
- The are spanning, but no proper subset is spanning.
- The are linearly independent, but adding any other element of makes them not linearly independent.
Exercise 3.25 (*) (Napkin 9C). Let’s say a magic square is a array of real numbers where the sum of all diagonals, columns, and rows is equal, such as
Show that the set of magic squares forms a vector space (with addition and scaling done component-wise) and calculate its dimension.