Skip to main content

Section 2.2 Vector Spaces I

Having concluded our reviews and introduced some new arithmetic, we now proceed to explore a famous structure in linear algebra - vector spaces. While many of you will go on to study these spaces over an arbitrary field, we will restrict our attention in this course to real and complex vector spaces. We will call this set of numbers \(K\) (so that \(K\) is either \(\mathbb{R}\) or \(\mathbb{C}\)). Let’s begin with the abstract definition.

Definition 2.2.1.

A vector space \(V\) over \(K\) is a set endowed with two operations, addition and scalar multiplication. Addition takes as its input two vectors \(\mb{v}_1\) and \(\mb{v}_2\) of \(V\) and outputs \(\mb{v}_1 + \mb{v}_2\text{.}\) Scalar multiplication takes a scalar \(\lambda\text{,}\) which is an element of \(K\text{,}\) and a vector \(\mb{v}\) and produces a vector \(\lambda \mb{v}\text{.}\) These operations have to satisfy the following properties
  1. There is an additive identity vector \(\mb{0}\text{,}\)
  2. Addition is commutative and associative,
  3. The number \(1\) acts as a scalar multiplication identity so that \(1 \mb{v} = \mb{v}\text{,}\)
  4. Scalar multiplication satisfies an associative-like property:
    \begin{equation*} (\lambda_1 \lambda_2) \mb{v} = \lambda_1 (\lambda_2 \mb{v}) \end{equation*}
    where \(\lambda_1, \lambda_2 \in K\) and \(\mb{v} \in V\text{,}\)
  5. Scalar multiplication distributes
    \begin{align*} \lambda (\mb{v}_1 + \mb{v}_2) \amp = \lambda \mb{v}_1 + \lambda \mb{v}_2, \\ (\lambda_1 + \lambda_2 ) \mb{v} \amp = \lambda_1 \mb{v} + \lambda_2 \mb{v}. \end{align*}
An extremely common alternative notation to using bold letters \(\mathbf{u}, \mathbf{v}, \mathbf{w}\) for vectors is to place an arrow above them as in \(\vec{u}, \vec{v}, \vec{w}\text{.}\) Having now seen the abstract definition, let us gather several examples.

Example 2.2.2. The vector space of column vectors.

By an overwhelming majority, the winner for the most popular vector space over \(K\) is the space of column vectors:
\begin{equation} K^n = \left\{ \left[ \begin{matrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{matrix} \right] : a_1, \ldots, a_n \text{ numbers in }K \right\} \tag{2.2.1} \end{equation}
Indeed, in some books and courses, this (or its row vector counterpart) is the only example considered. Here addition and scalar multiplication are defined by viewing columns as \(n \times 1\) matrices
\begin{equation*} \left[ \begin{matrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{matrix} \right] + \left[ \begin{matrix} b_1 \\ b_2 \\ \vdots \\ b_n \end{matrix} \right] = \left[ \begin{matrix} a_1 + b_1 \\ a_2 + b_2 \\ \vdots \\ a_n + b_n \end{matrix} \right] \end{equation*}
\begin{equation*} \lambda \left[ \begin{matrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{matrix} \right] = \left[ \begin{matrix} \lambda a_1 \\ \lambda a_2 \\ \vdots \\ \lambda a_n \end{matrix} \right]. \end{equation*}
There are some special vectors called standard basis vectors in \(K^n\) which we will denote by \(\mb{e}_1, \mb{e}_2, \cdots, \mb{e}_n\text{.}\) They are defined by
\begin{align*} \mb{e}_1 \amp = \left[\begin{matrix} 1\\ 0 \\ 0 \\ \vdots \\ 0 \end{matrix} \right] , \amp \mb{e}_2 \amp = \left[\begin{matrix} 0\\ 1 \\ 0 \\ \vdots \\ 0 \end{matrix} \right] , \amp \cdots \amp \amp \mb{e}_n \amp = \left[\begin{matrix} 0\\ 0 \\ 0 \\ \vdots \\ 1 \end{matrix} \right]. \end{align*}
One may ask why column vectors are so popular and there are a couple of very reasonable responses to this question. One is that we can compute very effectively with column vectors (as we will see for the remainder of our lives). Another is that every finite dimensional vector space over \(K\) is in a very precise sense equivalent to a space of column vectors. This second response is important, but it comes with a caveat which we will discuss when the time comes!

Example 2.2.3. The vector space of row vectors.

Rather than taking columns, we could consider row vectors
\begin{equation*} \left\{ \left[ \begin{matrix} a_1 \amp a_2 \amp \cdots \amp a_n \end{matrix} \right] : a_1, \ldots, a_n \text{ numbers in }K \right\}. \end{equation*}
Often texts will write these vectors with commas and angle brackets. I.e. as
\begin{equation*} \left\langle a_1, a_2, \ldots , a_n \right\rangle . \end{equation*}
Addition and scalar multiplication is given coordinate-wise as in the column case. In the \(n = 2\) and \(3\) dimensional cases (especially when \(K = \mathbb{R}\)), the standard basis vectors \(\mb{e}_1, \mb{e}_2, \mb{e}_3\) are usually denoted \(\mathbf{i}, \mathbf{j}, \mathbf{k}\text{.}\) This is somewhat historically motivated, but still very common.
Although we do, Sage is built not to care about the difference between row and column vectors. It uses the following syntax to define a vector and will interpret it as a column or a row, depending on how you operate on it.

Example 2.2.4. The vector space of matrices.

An example that generalizes both column and row vectors is the vector space of \(m \times n\) matrices
\begin{equation} M_{m, n} (K) = \left\{ \left[ \begin{matrix} a_{11} \amp a_{12} \amp \cdots \amp a_{1n} \\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n} \\ \vdots \amp \ddots \amp \amp \vdots \\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn} \end{matrix} \right] : a_{ij} \text{ numbers in }K \right\} \tag{2.2.2} \end{equation}
Addition and scalar multiplication were defined in Section 2.1.

Example 2.2.5. The vector space of polynomials.

A less common example, but useful one, is the vector space of polynomials of degree less than \(n\text{.}\) This can be written
\begin{equation} P_n (K) = \left\{ a_n x^n + \cdots + a_1 x + a_0 : a_0, a_1, \ldots, a_n \text{ numbers in } K \right\}.\tag{2.2.3} \end{equation}
When \(K\) is known, we may just write \(P_n\text{.}\) Addition and scalar multiplication are obtained by adding two polynomials or multiplying a polynomial by a number.

Example 2.2.6. The vector space of arrows.

A very useful geometric picture to have in mind for real vectors in \(2\) and \(3\) dimensions is the vector space of arrows. We equate two arrows if they have the same magnitude (or length) and the same direction. Adding arrows is accomplished by placing the initial point of one at the endpoint of the other and then drawing an arrow from the remaining initial point to the remaining endpoint. Scalar multiplication is obtained by scaling the magnitude (when the scale is positive) or reversing the direction and scaling (when the scale is negative).
This does indeed form a vector space over \(\mathbb{R}\text{.}\) It is nearly useless when it comes to computing, but it gives a much better picture of how vectors look and behave. As such, it will reappear frequently as we start applying vectors to ordinary differential equations and multivariable calculus.
All of the examples above share the property of being finite dimensional (which we will define soon). However, there are a great many vector spaces that do not have this property and are extensively studied.

Example 2.2.7. The vector space of continuous functions.

The space of continuous functions \(C(U)\) from a space \(U\) to \(K\) forms a vector space. Here addition is function addition and scalar multiplication is obtained by just multiplying a function by a number. More concretely, if \(f : U \to K\text{,}\) \(g : U \to K\) and \(\lambda \in K\) we take
\begin{align*} (f + g) (x) \amp := f(x) + g(x), \\ (\lambda f) (x) \amp := \lambda f(x). \end{align*}
There are a huge number of variants of Example 2.2.7 such as functions that are differentiable, bounded functions, functions that are integrable, and so on. The study of such vector spaces is one of the primary topics of functional analysis and we will only lightly dabble in this so as not to spoil the wonders that await!
One can also consider infinite column vectors or matrices, but we will stop this example madness here before it gets any further out of control. Instead, we give ourselves a bit more vocabulary concerning vectors and vector spaces.

Definition 2.2.8.

Given a vector space \(V\) over \(K\text{,}\) a vector subspace \(W\) of \(V\) is a subset which is also a vector space over \(K\) with the vector space operations inherited from \(V\text{.}\) This is denoted \(W \le V\text{.}\) A vector subspace is called proper if it is not equal to \(V\text{.}\)
Often we will refer to a vector subspace \(W\) as a linear subspace. This should come though with a big warning: with this vocabulary, not all lines are linear!
In order to verify that a given subset \(W\) of \(V\) is in fact a vector space, one needs to check that it is closed under addition and scalar multiplication. In other words, we need to see that if \(\mb{w}_0, \mb{w}_1\) are in \(W\) and \(\lambda\) is in \(K\text{,}\) then \(\mb{w}_0 + \mb{w}_1\) and \(\lambda \mb{w}_0\) are also in \(W\) (not just in \(V\)). We record this as a proposition.

Example 2.2.10. Subspace defined by an equation.

Consider the subset
\begin{equation*} W = \left\{ \left[ \begin{matrix} a \\ b \end{matrix} \right] : 2a + 3b = 0 \right\}. \end{equation*}
That this is a vector subspace of \(\mathbb{R}^2\) can be verified using Proposition 2.2.9. Suppose
\begin{equation*} \left[ \begin{matrix} a_0 \\ b_0 \end{matrix} \right] \text{ and } \left[ \begin{matrix} a_1 \\ b_1 \end{matrix} \right] \end{equation*}
are in \(W\text{.}\) Then
\begin{align*} 2a_0 + 3b_0 \amp = 0, \\ 2a_1 + 3b_1 \amp = 0 \end{align*}
so that adding them together gives
\begin{equation*} 2(a_0 + a_1) + 3(b_0 + b_1) = 0. \end{equation*}
But this implies that
\begin{equation*} \left[ \begin{matrix} a_0 + a_1 \\ b_0 + b_1 \end{matrix} \right] \end{equation*}
is in \(W\) so that \(W\) is closed under vector addition. A similar argument shows that it is closed under scalar multiplication.
Note that if we view the vector space \(\mathbb{R}^2\) geometrically as the plane, the subspace \(W\) is just the line of slope \(-2/3\) passing through the origin. In fact, as you will show in the exercises, any non-zero proper vector subspace of \(\mathbb{R}^2\) is a line through the origin.

Definition 2.2.11.

Given vectors \(\mb{v}_1, \mb{v}_2, \ldots, \mb{v}_n\) in a vector space \(V\) over \(K\) and numbers \(a_1, a_2, \ldots, a_n\) in \(K\text{,}\) we call the vector
\begin{equation*} a_1 \mb{v}_1 + a_2 \mb{v}_2 + \cdots + a_n \mb{v}_n \end{equation*}
a linear combination of \(\mb{v}_1, \ldots , \mb{v}_n\text{.}\) If \(S\) is a subset of \(V\text{,}\) the set of all linear combinations of vectors in \(S\) is called the span of \(S\) and is denoted \(\text{Span}(S)\text{.}\)
Linear combinations and span are essential vocabulary when communicating how vectors sweep out spaces. For example, a linear combination of a single non-zero vector \(\mb{v}\) in \(\mathbb{R}^3\) is just a scaling of \(\mb{v}\) and its span is the set of all such scale multiples; namely, a line through the origin in the direction of \(\mb{v}\text{.}\) On the other hand, taking the span of two vectors \(\mb{v}_1, \mb{v}_2\) which are not on the same line will give a plane through the origin. Moreover, if we remember these vectors we get coordinates on this plane by taking the point \((x,y)\) to the linear combination \(x \mb{v}_1 + y \mb{v}_2\text{.}\)
Sage has a class that is a vector space or subspace of another vector space. However, Sage (like us) cares about what \(K\) is for such a space. Often it is preferable to use the rational numbers \(K = \mathbb{Q}\) which Sage writes as QQ. If you evaluate the following snippet, Sage will output a vector subspace which is the span of the two vectors, along with some information about the subspace that is defined. We will learn about these terms in the coming sections.

Example 2.2.12. Linear combinations of rows and columns of a matrix.

A common way of viewing the matrix
\begin{equation*} A = \left[ \begin{matrix} a_{11} \amp a_{12} \amp \cdots \amp a_{1n} \\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n} \\ \vdots \amp \ddots \amp \amp \vdots \\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn} \end{matrix} \right] \end{equation*}
is as a column of \(m\) row vectors
\begin{equation*} \mb{r}_i = \left[ \begin{matrix} a_{i1} \amp a_{i2} \amp \cdots \amp a_{in} \end{matrix} \right] \end{equation*}
by just taking
\begin{equation*} A = \left[ \begin{matrix} - \amp \mb{r}_1 \amp - \\ - \amp \mb{r}_2 \amp - \\ \amp \vdots \amp \\ - \amp \mb{r}_m \amp - \end{matrix} \right] . \end{equation*}
In fact, this is how most computer programs will take the input of a matrix (as an array of arrays). This leads to a very fruitful way of thinking about matrix multiplication of \(A\) by a row vector on the left:
\begin{equation*} \left[ \begin{matrix} a_{1} \amp a_{2} \amp \cdots \amp a_{m} \end{matrix} \right] \left[ \begin{matrix} - \amp \mb{r}_1 \amp - \\ - \amp \mb{r}_2 \amp - \\ \amp \vdots \amp \\ - \amp \mb{r}_m \amp - \end{matrix} \right] = a_1 \mb{r}_1 + \cdots + a_m \mb{r}_m. \end{equation*}
Note that here, rather than multiplying each entry of the matrix by the scalar \(a_i\text{,}\) we are taking the whole row and scalar multiplying. We end up seeing that the result is a linear combination of the rows. A similar equation holds when we view \(A\) as a row of column vectors and multiply on the right by a column vector
\begin{equation*} \left[ \begin{matrix} | \amp | \amp \amp | \\ \mb{c}_1 \amp \mb{c}_2 \amp \cdots \amp \mb{c}_n \\ | \amp | \amp \amp | \end{matrix} \right] \left[ \begin{matrix} b_1 \\ b_2 \\ \vdots \\ b_n \end{matrix} \right] = b_1 \mb{c}_1 + b_2 \mb{c}_2 + \cdots b_n \mb{c}_n. \end{equation*}
As you will show in the exercises, the span of any non-empty subset of a vector space is a vector subspace. However, some sets of vectors are better than others when it comes to spans. For example, the span of the set of all vectors in \(\mathbb{R}^2\) is \(\mathbb{R}^2\text{,}\) but that is not saying much. On the other hand, the span of the two standard basis vectors \(\mb{e}_1, \mb{e}_2\) is also \(\mathbb{R}^2\text{,}\) yet for these vectors we get a property that we didn’t have before.

Definition 2.2.13.

An ordered set of vectors \(\mathcal{B} = \{\mb{v}_1, \ldots, \mb{v}_n\}\) is called a basis for a vector space \(V\) if every vector \(\mb{v}\) in \(V\) can be written uniquely as a linear combination of vectors in \(\mathcal{B}\text{.}\)
Note that the word ‘uniquely’ appears in this definition, and it is a very important word indeed. It means that, for any vector \(\mb{v}\text{,}\) the coefficients \(a_1, \ldots, a_n\) in the expression
\begin{equation} \mb{v} = a_1 \mb{v}_1 + a_2 \mb{v}_2 + \cdots + a_n \mb{v}_n\tag{2.2.4} \end{equation}
are the only possible ones that give equality.
As one is often interested in whether a given set of vectors \(\{v_1, \ldots, v_m\}\) in \(K^n\) is a basis, we will assert unambiguously that if there is any hope of this being true, we must have \(m = n\) (this will be proven later). Even then, it is not always the case that we have a basis. However, Sage can be used to detect whether a give set of row or column vectors \(\{v_1, \ldots, v_n\}\) in \(K^n\) is a basis. Indeed, one can simply define the vectors, take the span and check that the resulting subspace has dimension \(n\text{.}\) Why this works should be rather mysterious to the student at this point, but will be clarified in the coming sections.
A couple of comments on this definition are in order. First, we take a basis to be an ordered set of vectors, but often we don’t mention the ordering when it plays no role. It is not universally defined this way and occasionally is defined as just a set of vectors satisfying the uniqueness property and equation (2.2.4). Second, we defined a finite basis above, but one can also consider infinite ordered sets that are bases (‘bases’ is the plural of basis). However, in the infinite case there are more important variants to the above definition of basis involving infinite sums, so for now we will stick with the finite case.
On first exposure to the concept of a basis, a student may get the wildly incorrect idea that they are in short supply. In fact, there are infinitely many bases of any non-zero rational, real or complex vector space. Nonetheless, the key advantage to having a basis around is that you can label your vectors unambiguously with arrays of numbers and thus, you can compute!
More precisely, given a basis \(\mathcal{B}\) of \(V\) and a vector \(\mb{v}\text{,}\) we may assign \(\mb{v}\) to the array of numbers
\begin{equation} \coord{\mb{v}}{\mathcal{B}} := \left[ \begin{matrix} a_1 \\ a_2 \\ \vdots \\ a_n \end{matrix} \right] \tag{2.2.5} \end{equation}
where \(a_1, \ldots, a_n\) are precisely the unique coefficients in equation (2.2.4). This gives us a function
\begin{equation} \coord{}{\mathcal{B}} : V \to K^n .\tag{2.2.6} \end{equation}

Example 2.2.14. Using a basis to give vectors coordinates.

In the real case, one should think of a basis as giving a rigid set of coordinates, or a grid, that allows you to assign arrays of numbers to vectors. For example, the basis
\begin{equation*} \mathcal{B} = \left\{ \twovec{1}{-1} , \twovec{1}{1} \right\} \end{equation*}
in \(\mathbb{R}^2\) gives Cartesian coordinates rotated clockwise by \(45\) degrees and scaled by \(\sqrt{2}\text{.}\) The vector
\begin{equation*} \mb{v} = \twovec{1}{2} \end{equation*}
in this coordinate system is written
\begin{equation*} \coord{\mb{v}}{\mathcal{B}} = \twovec{\frac{3}{2}}{-\frac{1}{2}} \end{equation*}
because
\begin{equation*} \mb{v} = \twovec{1}{2} = \frac{3}{2} \twovec{1}{-1} + \left(-\frac{1}{2} \right) \twovec{1}{1}. \end{equation*}
To be clear, the abstract notion of a basis is that given in the definition. The computational perspective is that one can uniquely assign arrays of numbers to vectors and, as we will see, add and scalar multiply in an easy fashion. Finally, the geometric perspective is rooted in Descartes original insight that points in space could be given coordinates. This last perspective is extremely subtle in that the word ‘could’ has great importance. I will make the point here that a vector space is a space of vectors or points that does not come with a preferred set of coordinates (unless the space you start with is \(K^n\)). Once a basis is given, or chosen, we can then assign coordinates. Indeed, while we do not walk around with a three dimensional grid attached to our head, the space we live in still exists! I may tell you that `the coffee cup is on the table over there’, but you will not hear me say ‘the coffee cup is at \((-3, 2, 1)\)’.

Exercises Exercises

1.

Show that every non-zero proper vector subspace of \(\mathbb{R}^2\) is a line through the origin.

2.

Show that the span of any non-empty subset is a vector subspace.

3.

Give a basis for \(\mathbb{C}\) as a vector space over \(\mathbb{R}\text{.}\)

4.

Which, if any, of the following collections are bases? Explain your response.
\begin{gather*} \left\{ \twovec{4}{1}, \twovec{1}{1}, \twovec{0}{1} \right\} \subset \mathbb{R}^2 \\ \left\{ \twovec{-1}{1}, \twovec{0}{1} \right\} \subset \mathbb{R}^2 \\ \left\{ \threevec{1}{1}{1} , \threevec{0}{0}{-1} \right\} \subset \mathbb{R}^3 \end{gather*}

5.

Let
\begin{equation*} \mb{v} = \twovec{3}{-2} \end{equation*}
and
\begin{equation*} \mathcal{B} = \left\{ \twovec{1}{1} , \twovec{0}{-1} \right\}. \end{equation*}
What is \(\coord{\mb{v}}{\mathcal{B}}\text{?}\)

6.

Prove that the function \(\coord{}{\mathcal{B}}: V \to K^n\) is a one-to-one correspondence by giving a formula for the inverse function \((\coord{}{\mathcal{B}})^{-1} : K^n \to V\) and showing it is an inverse.