maths.freeLinear Algebra › 2. Vectors › Vector Operations

Vector Operations

In this section we define some new operations involving vectors, and collect some basic properties of these operations.

Vector Operations

In this section we define some new operations involving vectors, and collect some basic properties of these operations. Begin by recalling our definition of a column vector as an ordered list of complex numbers, written vertically (). The collection of all possible vectors of a fixed size is a commonly used set, so we start with its definition.

  1. Where have you seen vectors used before in other courses? How were they different?
  2. In words only, when are two vectors equal?
  3. 2\colvector{1\\5\\0} + (-3)\colvector{7\\6\\5}

Exercises T30, T31 and T32 are about making a careful definition of vector subtraction.

Column Vectors

When a set similar to this is defined using only column vectors where all the entries are from the real numbers, it is written as ${\mathbb R}^m$ and is known as Euclidean $m$-space.

The term vector is used in a variety of different ways. We have defined it as an ordered list written vertically. It could simply be an ordered list of numbers, and perhaps written as $\left\langle 2,\,3,\,-1,\,6\right\rangle$. Or it could be interpreted as a point in $m$ dimensions, such as $\left(3,\,4,\,-2\right)$ representing a point in three dimensions relative to $x$, $y$ and $z$ axes. With an interpretation as a point, we can construct an arrow from the origin to the point which is consistent with the notion that a vector has direction and magnitude.

All of these ideas can be shown to be related and equivalent, so keep that in mind as you connect the ideas of this course with ideas from other disciplines. For now, we will stick with the idea that a vector is just a list of numbers, in some particular order.

Vector Spaces of Column Vectors

It is possible to construct vector spaces several ways in Sage. For now, we will show you two basic ways. Remember that while our theory is all developed over the complex numbers, $\complexes$, it is better to initially illustrate these ideas in Sage using the rationals, QQ.

To create a vector space, we use the VectorSpace() constructor, which requires the name of the number system for the entries and the number of entries in each vector. We can display some information about the vector space, and with tab-completion you can see what functions are available. We will not do too much with these methods immediately, but instead learn about them as we progress through the theory.

Notice that the word dimension is used to refer to the number of entries in a vector contained in the vector space, whereas we have used the word degree before. Try pressing the Tab key while in the next cell to see the range of methods you can use on a vector space.

We can easily create random elements of any vector space, much as we did earlier for the kernel of a matrix. Try executing the next compute cell several times.

Vector spaces are a fundamental objects in Sage and in mathematics, and Sage has a nice compact way to create them, mimicking the notation we use when working on paper.

Sage can determine if two vector spaces are the same. Notice that we use two equals sign to test equality, since we use a single equals sign to make assignments.

Vector Equality, Addition, Scalar Multiplication

We start our study of this set by first defining what it means for two vectors to be the same.

Now this may seem like a silly (or even stupid) thing to say so carefully. Of course two vectors are equal if they are equal for each corresponding entry! Well, this is not as silly as it appears. We will see a few occasions later where the obvious definition is not the right one. And besides, in doing mathematics we need to be very careful about making all the necessary definitions and making them unambiguous. And we have done that here.

Notice now that the symbol = is now doing triple-duty. We know from our earlier education what it means for two numbers (real or complex) to be equal, and we take this for granted. In we defined what it meant for two sets to be equal. Now we have defined what it means for two vectors to be equal, and that definition builds on our definition for when two numbers are equal when we use the condition $u_i=v_i$ for all $1\leq i\leq m$. So think carefully about your objects when you see an equal sign and think about just which notion of equality you have encountered. This will be especially important when you are asked to construct proofs whose conclusion states that two objects are equal. If you have an electronic copy of the book, such as the PDF version, searching on Definition CVE can be an instructive exercise. See how often, and where, the definition is employed.

OK, let us do an example of vector equality that begins to hint at the utility of this definition.

Example: Vector equality for a system of equations

Consider the system of linear equations in ,

Note the use of three equals signs each indicates an equality of numbers (the linear expressions are numbers when we evaluate them with fixed values of the variable quantities). Now write the vector equality, \colvector{-7x_1 -6 x_2 - 12x_3\\ 5x_1 + 5x_2 + 7x_3\\ x_1 +4x_3} = \colvector{-33\\24\\5}. By , this single equality (of two column vectors) translates into three simultaneous equalities of numbers that form the system of equations. So with this new notion of vector equality we can become less reliant on referring to systems of simultaneous equations. There is more to vector equality than just this, but this is a good example for starters and we will develop it further.

Condensed — the full section is in Beezer, A First Course in Linear Algebra.

Vector Space Properties

With definitions of vector addition and scalar multiplication we can state, and prove, several properties of each operation, and some properties that involve their interplay. We now collect ten of them here for later reference.

Many of the conclusions of our theorems can be characterized as identities, especially when we are establishing basic properties of operations such as those in this section. Most of the properties listed in are examples. So some advice about the style we use for proving identities is appropriate right now. Have a look at .

Be careful with the notion of the vector $\vect{-u}$. This is a vector that we add to $\vect{u}$ so that the result is the particular vector $\zerovector$. This is basically a property of vector addition. It happens that we can compute $\vect{-u}$ using the other operation, scalar multiplication. We can prove this directly by writing that \vectorentry{\vect{-u}}{i} =-\vectorentry{\vect{u}}{i} =(-1)\vectorentry{\vect{u}}{i} =\vectorentry{(-1)\vect{u}}{i} We will see later how to derive this property as a consequence of several of the ten properties listed in .

Similarly, we will often write something you would immediately recognize as vector subtraction. This could be placed on a firm theoretical foundation as you can do yourself with .

A final note. implies that we do not have to be careful about how we parenthesize the addition of vectors. In other words, there is nothing to be gained by writing $\left(\vect{u}+\vect{v}\right)+\left(\vect{w}+\left(\vect{x}+\vect{y}\right)\right)$ rather than $\vect{u}+\vect{v}+\vect{w}+\vect{x}+\vect{y}$, since we get the same result no matter which order we choose to perform the four additions. So we will not be careful about using parentheses this way.

Condensed — the full section is in Beezer, A First Course in Linear Algebra.

Symbols used here

i
imaginary unit
i² = −1.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\mathbf{v},\ \vec{v}
vector
A quantity with magnitude and direction; a column of numbers.
A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}
matrix
A rectangular array of numbers; a linear map.
\det A,\ |A|
determinant
Scaling factor of area/volume under A; zero means singular.
A^{-1},\ A^{T}
inverse, transpose
The matrix that undoes A; A with rows and columns swapped.
\lambda
lambda (eigenvalue)
The factor by which an eigenvector is stretched: Av = λv.
\mathbf{u} \cdot \mathbf{v},\ \|\mathbf{v}\|
dot product, norm
Σ u_i v_i; the length of v, √(v·v).

Questions people ask

What does a determinant mean geometrically?

It is the factor by which the matrix scales area (2×2) or volume (3×3), with a negative sign if orientation flips. Zero means the matrix flattens space and cannot be undone.

What is an eigenvector?

A direction the matrix does not turn — it only stretches it by the eigenvalue. Along eigenvectors a complicated matrix acts like multiplication by a number.

Why is matrix multiplication not commutative?

Because a matrix is a transformation and AB means "do B, then A". Rotating then reflecting is not the same as reflecting then rotating.

Kokeile omaasi

Parts of this page are adapted from Beezer, A First Course in Linear Algebra (GFDL 1.2). Condensed and re-explained here; errors are ours.

Lisää Linear Algebra