Section VO 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 (Definition CV). The collection of all possible vectors of a fixed size is a commonly used set, so we start with its definition.
Subsection CV Column Vectors
Definition VSCV. Vector Space of Column Vectors.
The vector space \(\complex{m}\) is the set of all column vectors (Definition CV) of size \(m\) with entries from the set of complex numbers, \(\complexes\text{.}\)
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\text{.}\) 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\text{,}\) \(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.
Sage VSCV. 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\text{,}\) 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. If the way you use Sage provides tab-completion, then press 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 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. While the next example includes the Sage version of the complex numbers, remember to be sure to do all your calculations with the rationals, QQ
.
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.
Subsection VEASM 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.
Definition CVE. Column Vector Equality.
Suppose that \(\vect{u},\,\vect{v}\in\complex{m}\text{.}\) Then \(\vect{u}\) and \(\vect{v}\) are equal, written \(\vect{u}=\vect{v}\) if
for all \(1\leq i\leq m\text{.}\)
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 Definition SE 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 this new definition builds on our prior definition for when two numbers are equal when we use the condition \(\vectorentry{\vect{u}}{i}=\vectorentry{\vect{v}}{i}\) repeatedly, for all \(1\leq i\leq m\text{.}\) 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 VESE. Vector equality for a system of equations.
Consider the system of linear equations in Archetype B,
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,
By Definition CVE, 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.
We will now define two operations on the set \(\complex{m}\text{.}\) By this we mean well-defined procedures that somehow convert vectors into other vectors. Here are two of the most basic definitions of the entire course.
Definition CVA. Column Vector Addition.
Suppose that \(\vect{u},\,\vect{v}\in\complex{m}\text{.}\) The sum of \(\vect{u}\) and \(\vect{v}\) is the vector \(\vect{u}+\vect{v}\) defined by
for \(1\leq i\leq m\text{.}\)
So vector addition takes two vectors of the same size and combines them (in a natural way!) to create a new vector of the same size. Notice that this definition is required, even if we agree that this is the obvious, right, natural or correct way to do it. Notice too that the symbol ‘+’ is being recycled. We all know how to add numbers, but now we have the same symbol extended to double-duty and we use it to indicate how to add two new objects, vectors. And this definition of our new addition of vectors is built on our prior meaning of addition of numbers in the expressions \(\vectorentry{\vect{u}}{i}+\vectorentry{\vect{v}}{i}\text{.}\) Think about your objects, especially when doing proofs. Vector addition is easy, here is an example from \(\complex{4}\text{.}\)
Example VA. Addition of two vectors in \(\complex{4}\).
For vectors \(\vect{u},\,\vect{v}\text{,}\) their sum is
Our second operation takes two objects of different types, specifically a number and a vector, and combines them to create another vector. In this context we call the number a scalar in order to emphasize that it is not a vector.
Definition CVSM. Column Vector Scalar Multiplication.
Suppose \(\vect{u}\in\complex{m}\) and \(\alpha\in\complexes\text{,}\) then the scalar multiple of \(\vect{u}\) by \(\alpha\) is the vector \(\alpha\vect{u}\) defined by
for \(1\leq i\leq m\text{.}\)
Notice that we are doing a kind of multiplication here, but we are defining a new type, perhaps in what appears to be a natural way. We use juxtaposition (smashing two symbols together side-by-side) to denote this operation rather than using a symbol like we did with vector addition. So this can be another source of confusion. When two symbols are next to each other, are we doing regular old multiplication, the kind we have done for years, or are we doing scalar vector multiplication, the operation we just defined? Think about your objects — if the first object is a scalar, and the second is a vector, then it must be that we are doing our new operation, and the result of this operation will be another vector.
Notice how consistency in notation can be an aid here. If we write scalars as lower case Greek letters from the start of the alphabet (such as \(\alpha\text{,}\) \(\beta\text{,}\) …) and write vectors in bold Latin letters from the end of the alphabet (\(\vect{u}\text{,}\) \(\vect{v}\text{,}\) …), then we have some hints about what type of objects we are working with. This can be a blessing and a curse, since when we go read another book about linear algebra, or read an application in another discipline (physics, economics, …) the types of notation employed may be very different and hence unfamiliar.
Again, computationally, vector scalar multiplication is very easy.
Example CVSM. Scalar multiplication in \(\complex{5}\).
For \(\vect{u}\) and \(\alpha=6\) we have
Sage VO. Vector Operations.
Sage can easily perform the two basic operations with vectors, vector addition, +
, and scalar vector multiplication, *
. Notice that Sage is not confused by an ambiguity due to multiple meanings for the symbols +
and *
— for example, Sage knows that 3 + 12
is different than the vector additions below.
Subsection VSP 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.
Theorem VSPCV. Vector Space Properties of Column Vectors.
Suppose that \(\complex{m}\) is the set of column vectors of size \(m\) (Definition VSCV) with addition and scalar multiplication as defined in Definition CVA and Definition CVSM. Then
- ACC Additive Closure, Column Vectors
If \(\vect{u},\,\vect{v}\in\complex{m}\text{,}\) then \(\vect{u}+\vect{v}\in\complex{m}\text{.}\)
- SCC Scalar Closure, Column Vectors
If \(\alpha\in\complexes\) and \(\vect{u}\in\complex{m}\text{,}\) then \(\alpha\vect{u}\in\complex{m}\text{.}\)
- CC Commutativity, Column Vectors
If \(\vect{u},\,\vect{v}\in\complex{m}\text{,}\) then \(\vect{u}+\vect{v}=\vect{v}+\vect{u}\text{.}\)
- AAC Additive Associativity, Column Vectors
If \(\vect{u},\,\vect{v},\,\vect{w}\in\complex{m}\text{,}\) then \(\vect{u}+\left(\vect{v}+\vect{w}\right)=\left(\vect{u}+\vect{v}\right)+\vect{w}\text{.}\)
- ZC Zero Vector, Column Vectors
There is a vector, \(\zerovector\text{,}\) called the zero vector, such that \(\vect{u}+\zerovector=\vect{u}\) for all \(\vect{u}\in\complex{m}\text{.}\)
- AIC Additive Inverses, Column Vectors
If \(\vect{u}\in\complex{m}\text{,}\) then there exists a vector \(\vect{-u}\in\complex{m}\) so that \(\vect{u}+ (\vect{-u})=\zerovector\text{.}\)
- SMAC Scalar Multiplication Associativity, Column Vectors
If \(\alpha,\,\beta\in\complexes\) and \(\vect{u}\in\complex{m}\text{,}\) then \(\alpha(\beta\vect{u})=(\alpha\beta)\vect{u}\text{.}\)
- DVAC Distributivity across Vector Addition, Column Vectors
If \(\alpha\in\complexes\) and \(\vect{u},\,\vect{v}\in\complex{m}\text{,}\) then \(\alpha(\vect{u}+\vect{v})=\alpha\vect{u}+\alpha\vect{v}\text{.}\)
- DSAC Distributivity across Scalar Addition, Column Vectors
If \(\alpha,\,\beta\in\complexes\) and \(\vect{u}\in\complex{m}\text{,}\) then \((\alpha+\beta)\vect{u}=\alpha\vect{u}+\beta\vect{u}\text{.}\)
- OC One, Column Vectors
If \(\vect{u}\in\complex{m}\text{,}\) then \(1\vect{u}=\vect{u}\text{.}\)
Proof.
While some of these properties seem very obvious, they all require proof. However, the proofs are not very interesting, and border on tedious. We will prove one version of distributivity very carefully, and you can test your proof-building skills on some of the others. Exercise VO.T13 has a proof in the solution, while Exercises VO.T17 and VO.T18 are excellent practice.
We need to establish an equality, so we will do so by beginning with one side of the equality, apply various definitions and theorems (listed to the right of each step) to massage the expression from the left into the expression on the right. Here we go with a proof of Property DSAC.
For \(1\leq i\leq m\text{,}\)
Since the individual components of the vectors \((\alpha+\beta)\vect{u}\) and \(\alpha\vect{u}+\beta\vect{u}\) are equal for all \(i\text{,}\) \(1\leq i\leq m\text{,}\) Definition CVE tells us the vectors are equal.
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 Theorem VSPCV are examples. So some advice about the style we use for proving identities is appropriate right now. Have a look at Proof Technique PI.
Be careful with the notion of the vector \(\vect{-u}\text{.}\) This is a vector that we add to \(\vect{u}\) so that the result is the particular vector \(\zerovector\text{.}\) 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
We will see later how to derive this property as a consequence of several of the ten properties listed in Theorem VSPCV.
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 Exercise VO.T30.
A final note. Property AAC 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}\text{,}\) 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.
Sage ANC. A Note on Coercion.
Study the following sequence of commands, while cognizant of the failure to specify a number system for x
.
None of this should be too much of a surprise, and the results should be what we would have expected. Though for x
we never specified if 1, 2, 3
are integers, rationals, reals, complexes, or …? Let us dig a little deeper and examine the parents of the five vectors involved.
So x
and u
belong to something called an “ambient free module,” whatever that is. What is important here is that the parent of x
uses the integers as its number system. How about u
, v
, y
, w
, z
? All but the first has a parent that uses the rationals for its number system.
Three of the final four vectors are examples of a process that Sage calls “coercion.” Mathematical elements get converted to a new parent, as necessary, when the conversion is totally unambiguous. In the examples above:
-
u
is the result of scalar multiplication by an integer, so the computation and result can all be accommodated within the integers as the number system. -
v
involves scalar multiplication by a scalar that is not an integer, and which could be construed as a rational number. So the result needs to have a parent whose number system is the rationals. -
y
is created explicitly as a vector whose entries are rational numbers. - Even though
w
is created only with products of integers, the fact thaty
has entries considered as rational numbers, so too does the result. - The creation of
z
is the result of adding a vector of integers to a vector of rationals. This is the best example of coercion — Sage promotesx
to a vector of rationals and therefore returns a result that is a vector of rationals. Notice that there is no ambiguity and no argument about how to promotex
, and the same would be true for any vector full of integers.
The coercion above is automatic, but we can also usually force it to happen without employing an operation.
So the syntax is to use the name of the parent like a function and coerce the element into the new parent. This can fail if there is no natural way to make the conversion.
Coercion is one of the more mysterious aspects of Sage, and the above discussion may not be very clear the first time though. But if you get an error (like the one above) talking about coercion, you know to come back here and have another read through. For now, be sure to create all your vectors and matrices over QQ
and you should not have any difficulties.
Reading Questions VO Reading Questions
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.
Perform the following computation with vector operations
Exercises VO Exercises
C10.
Compute
\(\colvector{5\\-13\\26\\1\\-6}\text{.}\)
C11.
Solve the given vector equation for \(x\text{,}\) or explain why no solution exists.
Performing the indicated operations (Definition CVA, Definition CVSM), we obtain the vector equations
Since the entries of the vectors must be equal by Definition CVE, we have \(-3 + 4x = 17\text{,}\) which leads to \(x = 5\text{.}\)
C12.
Solve the given vector equation for \(\alpha\text{,}\) or explain why no solution exists.
Performing the indicated operations (Definition CVA, Definition CVSM), we obtain the vector equations
Thus, if a solution \(\alpha\) exists, by Definition CVE then \(\alpha\) must satisfy the three equations
which leads to \(\alpha = -13\text{,}\) \(\alpha = -8\) and \(\alpha = 4\text{.}\) Since \(\alpha\) cannot simultaneously have three different values, there is no solution to the original vector equation.
C13.
Solve the given vector equation for \(\alpha\text{,}\) or explain why no solution exists.
Performing the indicated operations (Definition CVA, Definition CVSM), we obtain the vector equations
Thus, if a solution \(\alpha\) exists, by Definition CVE then \(\alpha\) must satisfy the three equations
which leads to \(3\alpha = -6\text{,}\) \(2\alpha = -4\) and \(-2\alpha = 4\text{.}\) And thus, the solution to the given vector equation is \(\alpha = -2\text{.}\)
C14.
Find \(\alpha\) and \(\beta\) that solve the vector equation
Performing the indicated operations (Definition CVA, Definition CVSM), we obtain the vector equations
Since the entries of the vectors must be equal by Definition CVE, we have \(\alpha = 3\) and \(\beta = 2\text{.}\)
C15.
Find \(\alpha\) and \(\beta\) that solve the vector equation.
Performing the indicated operations (Definition CVA, Definition CVSM), we obtain the vector equations
Since the entries of the vectors must be equal by Definition CVE, we obtain the system of equations
which we can solve by row-reducing the augmented matrix of the system
Thus, the only solution is \(\alpha = 3\text{,}\) \(\beta = -1\text{.}\)
T05.
Provide reasons (mostly vector space properties) as justification for each of the seven steps of the proof of the following theorem.
For any vectors \(\vect{u},\,\vect{v},\,\vect{w}\in\complex{m}\text{,}\) if \(\vect{u} + \vect{v} = \vect{u} + \vect{w}\text{,}\) then \(\vect{v} = \vect{w}\text{.}\)
Proof: Let \(\vect{u},\,\vect{v},\,\vect{w}\in\complex{m}\text{,}\) and suppose \(\vect{u} + \vect{v} = \vect{u} + \vect{w}\text{.}\)
T06.
Provide reasons (mostly vector space properties) as justification for each of the six steps of the proof of the following theorem.
For any vector \(\vect{u}\in\complex{m}\text{,}\) \(0\vect{u}=\zerovector\text{.}\)
Proof: Let \(\vect{u}\in\complex{m}\text{.}\)
T07.
Provide reasons (mostly vector space properties) as justification for each of the six steps of the proof of the following theorem.
For any scalar \(c\text{,}\) \(c\,\zerovector = \zerovector\text{.}\)
Proof: Let \(c\) be an arbitrary scalar.
T13.
Prove Property CC of Theorem VSPCV. Write your proof in the style of the proof of Property DSAC given in this section.
For all \(1\leq i\leq m\text{,}\)
With equality of each component of the vectors \(\vect{u}+\vect{v}\) and \(\vect{v}+\vect{u}\) being equal Definition CVE tells us the two vectors are equal.
T17.
Prove Property SMAC of Theorem VSPCV. Write your proof in the style of the proof of Property DSAC given in this section.
T18.
Prove Property DVAC of Theorem VSPCV. Write your proof in the style of the proof of Property DSAC given in this section.
Exercises T30, T31 and T32 are about making a careful definition of vector subtraction.
T30.
Suppose \(\vect{u}\) and \(\vect{v}\) are two vectors in \(\complex{m}\text{.}\) Define a new operation, called “subtraction,” as the new vector denoted \(\vect{u}-\vect{v}\) and defined by
for \(1\leq i\leq m\text{.}\) Prove that we can express the subtraction of two vectors in terms of our two basic operations. More precisely, prove that \(\vect{u}-\vect{v}=\vect{u}+(-1)\vect{v}\text{.}\) So in a sense, subtraction is not something new and different, but is just a convenience. Mimic the style of similar proofs in this section.
T31.
Prove, by giving counterexamples, that vector subtraction is not commutative and not associative.
T32.
Prove that vector subtraction obeys a distributive property. Specifically, prove that \(\alpha\left(\vect{u}-\vect{v}\right)=\alpha\vect{u}-\alpha\vect{v}\text{.}\)
Can you give two different proofs? Distinguish your two proofs by using the alternate descriptions of vector subtraction provided by Exercise VO.T30.