Visual Linear Algebra Online, Section 1.5
In mathematics, a matrix is not a simulated reality, but instead just a plain-old rectangular array of numbers. This does not mean, however, that mathematical matrices are uninteresting.
In fact, we will ultimately see that matrices have a ton of fascinating interpretations and applications.
Matrices can be of any “size”. In general, an real matrix is an array of real numbers with rows and columns. For example, the matrix shown below is a real matrix.
Some people think matrices look nicer if we use square brackets [ ] rather than parentheses ( ) to contain it. The object below represents the exact same matrix as the one above.
We will use both notations in Visual Linear Algebra Online. However, in this section, we will stick with parentheses because our matrices will be relatively “small”. In fact, we could even use the label “small matrices”. In this section, we explore the relationship between such small matrices and linear transformations in two dimensions, as well as even in one-dimension. Starting in the next section of this online textbook we will explore higher-dimensional situations.
Before we continue, you should realize that a two-dimensional vector can certainly be thought of as a matrix. In fact, you should also realize that a real number can even be thought of either as a one-dimensional vector or as a matrix (or )!!!
Low-Dimensional Linear Transformations
Recall from Section 1.4, “Linear Transformations in Two Dimensions” that a transformation (function) is said to be linear if for all vectors and in the domain of and all scalars (real numbers) and . This will essentially be the definition of linearity we use throughout this online textbook, no matter what the situation is.
Also recall that represents the real line (the set of real numbers) and represents the plane.
Linear Transformations
As explored in the exercises of Section 1.4, “Linear Transformations in Two Dimensions”, a function defined by the formula is a linear transformation if and only if .
In fact, it can also be shown that if is a linear transformation, it must be of the form for some constant , though this is harder to prove.
Of course, in rectangular coordinates, the graph of such a function is a straight line through the origin (with slope ).
Since numbers can be thought of as matrices, this equation can be written as . In other words, to find the output at the input , multiply the matrix times the matrix . Do this by multiplying the number by the number .
In fact, if we let and , we can then write . (Read this as “ of equals times “.) We could also write this as . (Read this in the same kind of way.)
Yes, this may seem weird. But the weirdness is worth it!!!
For what reason? Because it leads to natural generalizations.
We now generalize.
Linear Transformations
What is the form of a linear transformation ?
Based on the more basic notion of linearity from calculus, as well as the “new” version of linearity from Section 1.4, “Linear Transformations in Two Dimensions”, we might hope the statement below is true for . This statement is indeed an important mathematical statement of fact, so we label it with the word “Theorem”.
Theorem 1.5.1: Let , and be (real) constants. Then a function defined by is a linear transformation if and only if .
Theorems Require Proof
Any mathematical statement of fact like this technically requires a proof before we should believe it. Proofs are, in fact, an essential part of any course on linear algebra. We will emphasize them less than most textbooks. But we will still do them sometimes, including in this section.
This particular theorem is an “if and only if” statement. Because of this, there are really two logical implications to prove.
- If is a linear transformation, then , and
- If , then is a linear transformation.
The Proof
We now commence with the proof.
Proof:
Suppose first that is a linear transformation. This means that for any numbers . (Our input “vectors” here are actually numbers and , as well as the linear combination . The output of is a “true” vector.)
Now calculate using the formula for and vector operations. We have
and
.
Since for any choice of , it must be the case that and for any choices of . The only way this can happen is if , so this is what we conclude.
To prove the other (reverse) implication, start by assuming that . We must then prove that is a linear transformation. In other words, we must show that for any numbers .
But for such arbitrary numbers, this is easily done with a couple vector calculations as follows.
and
Q.E.D.
Side Note: when a mathematician finishes a proof, they often get very excited and start talking in Latin. The abbreviation Q.E.D. stands for “Quad Erat Demonstrandum“. It basically means “that which was to be demonstrated“. In other words, “We are done! Yay!“
THE Form of the Formula
The formula can be thought of as the scalar times the vector . In other words, .
If, instead, we want to think of this as a “matrix multiplication”, it will be standard to put the on the right and use parentheses or square brackets . If we let , then we can write:
.
Once again, make sure you realize the subtle point that is “ of ” while is “ times “. In fact, this is a point where it might be more clear to write rather than .
If we let , this can also be written as .
We are therefore multiplying a matrix by a matrix to get a matrix (vector) .
Once again, this may seem weird. But the weirdness is worth it!!!
We continue generalizing further below. For the moment, we discuss how to graph such a linear transformation.
This Graph (IMAGE) of Such A Linear Transformation is a Parameterized Line through the origin
The name of this text is Visual Linear Algebra Online. So let’s start visualizing!
A linear transformation with formula (or, as a point rather than a vector, ) can be visualized as a “parametric curve” as the “parameter” varies over .
If either or , this will be a straight line through the origin parallel to the nonzero vector . If , it will just be the origin.
In the animation below, and . The parameter varies from to . If we let vary over , the resulting line (going on forever and ever) would be the image of the linear transformation over its entire domain. The image is a one-dimensional subset of the two-dimensional space . Clearly, such a linear transformation cannot be an onto function. There are plenty of points in that are not in the image .
Such a function is one-to-one, however (when either or ). If , then . But this implies that and . Since either or , we can conclude that . Therefore, distinct inputs correspond to distinct outputs.
Linear Transformations
What is the form of a linear transformation ? We state the answer as a theorem.
Theorem 1.5.2: Let and be (real) constants. Then a function defined by is a linear transformation if and only if .
Once again, this is an “if and only if” statement, so the proof requires two parts.
Proof:
Suppose that a function defined by is a linear transformation. Then, for any scalars and any vectors , we can say that .
Using the formula for , we compute
.
On the other hand,
This simplifies to
.
Since and are arbitrary and these final expressions are equal, this implies that .
To prove the other (reverse) implication, start by assuming that . We must then prove that is a linear transformation.
Let and be given. The proof is finished with a couple computations.
and
.
These last two expressions are equal. We are done.
Q.E.D.
THE FORM OF THE FORMULA
The formula can be thought of as the dot product of the vector and the vector (see information about dot products in Section 1.2, “Vectors in Two Dimensions”). In other words, we can write .
Alternatively, if we think of as a one-dimensional vector ( matrix) , we can, by the definition of vector addition and scalar multiplication, write it as (or as , but we are writing it as for a good reason).
The expression is a “linear combination” of the one-dimensional vectors ( matrices) and . The values are called the weights in this linear combination (they are sometimes called the scalars or coefficients in the linear combination as well).
By convention (and it is a good convention), we now also think of as the product of the matrix with the matrix .
Symbolically, we write:
.
If and , this can also be written as .
Yet again, this may seem weird. But the weirdness is worth it!!!
SUCH A LINEAR TRANSFORMATION Has a Graph which is a Plane Through the Origin in Three-Dimensional Space
We have not yet discussed rectangular coordinates in three-dimensional space . That will be rectified right now.
First of all, you should realize that three-dimensional space is essentially just the space we live in — minus any objects “in” it at all. It is the space of height, width, and depth. It is an idealized three-dimensional “world of the mind”.
Rectangular Coordinates in 3D
As with the plane, we can impose a rectangular (Cartesian) coordinate system on three-dimensional space. We first choose a point to be the origin and then choose three mutually-perpendicular lines to be our axes. Orientations of the positive directions for these axes should also be chosen.
The resulting picture might look something like what is shown below, with axes labeled , and . Of course, this must be imagined with perspective to truly “see” its three-dimensional nature.
Given a point , we define its three-dimensional rectangular coordinates in the following way. Let be the signed distance of to the -plane (the plane containing the -axis and -axis). Let be the signed distance of to the -plane (the plane containing the -axis and -axis). And let be the signed distance of to the -plane (the plane containing the -axis and -axis). We illustrate this below. The rectangular coordinates of the (red) point in question are . Notice that the point is “behind” the -plane, where . Of course, the meaning of “behind” depends on your viewing perspective.
Three-Dimensional “Graph Paper”
We could also think of this in terms of three-dimensional “graph paper” with “boxes” (cubes), as illustrated below.
Graphs of Linear Transformations in 3D
For any function , linear or not, its graph is defined as the set .
To draw this graph, it is usually a matter of plotting a bunch of points in 3D and “connecting” these points with a two-dimensional “surface” that fits them. The graph will typically be a surface because the domain is two-dimensional.
For a linear transformation (function), when rectangular coordinates are used, this will result in a graph which is a plane through the origin in .
For example, suppose , , and . Examples of points that can be plotted from this formula include , , , and .
Here is the resulting graph, with the computed points highlighted. The first three are blue and the one at the origin is red. Make sure you understand which blue point has which coordinates. Note that the positive -axis goes “into” the screen.
Discussion of Properties
Is T Onto?
Suppose has the formula . If either or , then will definitely be onto. If , then is definitely not onto.
To confirm the first statement of the previous paragraph, let be arbitrary. If , then . If , then .
Is T one-to-one?
On the other hand, no matter what the values of and are, will most definitely not be one-to-one.
If , then every point gets mapped to the number 0.
On the other hand, if, for example, , then the set is the set of all points/vectors that get mapped to zero. This is a (parametrically-defined) line through the origin parallel to the vector .
This last set has two common names. We call it either a) the null space of (the word “null” emphasizes that it is the set of all points/vectors that get mapped to zero) or b) the kernel of .
Actually, the first name is more commonly used when referring to the matrix that defines by the formula , but we will use both names.
The null space (kernel) of the example is shown below. Note that it is a line through the origin.
Linear Transformations
By now, you might be able to guess the formula for a linear transformation .
the form of the formula
The general formula is of the form for some constants . We will leave a proof of this to the exercises.
Notice that the output is a linear combination of two vectors.
.
Now we already know that . This is a linear combination of and with and as the weights.
Likewise, . This is a linear combination of and with and as the weights.
Now imagine “stacking” the matrices and on top of each other. This gives a matrix . Now write the following equation, when :
For an arbitrary matrix and an arbitrary two-dimensional vector ( matrix) , it therefore makes sense to define the product as follows. It is the two-dimensional vector obtained by forming a linear combination of the columns of with the entries of as the weights.
This last statement is the key definition that will generalize to higher dimensions. It is also a key to understanding the relationships between matrix multiplication and many applications.
Summary
To summarize, suppose is a linear transformation. Then for some constants . If and , then .
Always remember! Read this as: of equals times !
The matrix/vector product is called the (standard) matrix representation of the output of linear transformation . The matrix itself is called the (standard) matrix of .
And, once again, the output of is a linear combination of the columns of . The entries of are the weights of the linear combination. That is, the output of is:
.
Discussion of Properties
In the previous section, Section 1.4, “Linear Transformations in Two Dimensions”, we considered many examples of transformations . We visualized these examples in two ways: 1) as mappings and 2) as vector fields.
For the linear transformation examples we considered in Section 1.4, all but one were both one-to-one and onto functions. Only the projection mapping was neither one-to-one nor onto.
In mathematics, it is dangerous to reason inductively from examples to general principles. Mathematics is based on deductive reasoning. However, it does turn out to be true that “most” linear transformations are both one-to-one and onto. We can make this precise by stating the following theorem.
Theorem 1.5.3: Let be a linear transformation defined by . Then is one-to-one and onto if and only if .
Recall from Section 1.3, “Systems of Linear Equations in Two Dimensions” that the quantity is called the determinant of the matrix . Our shorthand symbol for this quantity will be .
Therefore, this statement of this theorem is equivalent to saying the following. A linear transformation is one-to-one and onto if and only if its matrix has .
The following statement is also a theorem.
Theorem 1.5.4: Let be the matrix for a linear transformation . Then the null space (kernel) of is just the origin if and only if .
partial proof of Theorem 1.5.4
We will leave a proof of Theorem 1.5.3 for the exercises. Instead, we will provide a (partial) proof of Theorem 1.5.4 by using Theorem 1.5.3 (assuming it is true). It will also be necessary to use the linearity of .
Partial Proof:
Suppose first that . Then Theorem 1.5.3 implies that defined by is one-to-one and onto.
Now clearly . This means that is an element of the null space (kernel) of .
But there can be no other elements in the null space of . For if there were some other nonzero element , this would contradict the fact that is one-to-one.
The reverse implication will only be done partially. Suppose that has a null space that is only the zero vector .
We want to prove first that is one-to-one. Towards this end, assume that . The linearity of allows us to then conclude that . But now our assumption about the null space of helps us see that so that .
It is at this point that this writing becomes a “partial” proof. We will not prove the claim that is onto.
This is because doing so would involve doing calculations that would prove (more directly), that . Our purpose is to make us of Theorem 1.5.3 instead.
So, we finish this partial proof by just stating that is onto. Thus, by Theorem 1.5.3, .
Q.E.D.
Row Operations on Small Matrices
In Section 1.3, we discussed (elementary) “row operations” on systems of two equations and two unknowns. We finish of this section by describing elementary row operations on small matrices. These operations will allow us to solve systems of linear equations more quickly. They can also be generalized to higher dimensions (larger matrices) and can be used to answer questions about linear transformations. These questions include determining when linear transformations are one-to-one and/or onto.
Before we get into these row operations, we look at the relationships between all the main concepts discussed so far in this online textbook.
Systems of Linear Equations, Matrices, Vectors, and Linear Transformations
Systems of Linear Equations, Matrices, and Vectors
Suppose the numbers and are given. Consider the following system of two linear equations and two unknowns and .
In Section 1.3, we saw that elimination (of unknowns) through the use of row operations could be used to transform this system to the following equivalent system when the determinant .
Using vector notation, these two systems of linear equations can be written as two vector equations.
, and
Based on our definition of matrix/vector multiplication, we can also write the following.
, and
If , , and , then the first of these matrix/vector equations can be shortened to .
As a convention, the second will be shortened to , where is the so-called “inverse matrix” of . Clearly, it exists when the determinant .
Systems of Linear Equations and Linear Transformations
Let be the linear transformation defined by .
If we are given , then solving the system
is equivalent to determining a vector such that .
Here are the punchlines. 1) The solution of the system exists for any and exactly when is onto. And 2) For a given and where the solution exists, it will be unique exactly when is one-to-one.
When the matrix of is , existence and uniqueness are equivalent. This is not the case in general, however.
Elementary Row Operations on Augmented Matrices
Let us consider a couple examples where elementary row operations on matrices are used to answer questions about linear transformations.
Example 1
The Linear transformation
Suppose is the linear transformation defined by , where and . Suppose . We wish to answer the following questions: 1) Does a solution of exist? And 2) If it exists, is it unique? And 3) What is/are the solution(s)?
the corresponding system
This is the same as asking essentially the same set of questions about the linear system
elementary row operations applied to the augmented matrix
Instead of applying row operations to the system of equations, we apply them to the following augmented matrix, where the numbers on the right-hand sides of the equations form a 3rd column. This is justified because the variables in the system of equations just serve as “placeholders” of the calculations. The “real action” of elimination is in the coefficients and numbers on the right-hand sides.
Now we proceed with elementary row operations that will give us an equivalent system that has the unknowns and explicitly solved for.
First, multiply row 1 by and add it to row 2 to obtain a “new” row 2 that has a “0” in the lower left corner (representing elimination of the -term in the second equation).
Symbolically we write this as .
Next, make the in the second row become a by multiplying the second row by . Represent this symbolically as .
The second row now represents the equation , but we don’t stop here. Our next step is to eliminate the 2 from the first row above the 1 in the second row. Do this by multiplying the second row by , adding it to the first row, and replacing the first row. This is the operation .
the unique solution
From this, we see the final answers are and . In other words, the solution exists (the system is consistent), the solution is unique, and the solution is the point . You should check this in the original system.
There will be a unique solution for any in Example 1 since .
Example 2
For example 2, we consider the linear transformation defined by .
Note that . Hence, will be neither one-to-one nor onto.
Instead of picking a specific and doing what we did in Example 1, we let be arbitrary. We seek conditions on the values of and for when the solution will or will not exist and when it will or will not be unique.
Here is the first elementary row operation on an arbitrary augmented matrix.
Interpreting the Equivalent (reduced) form of the system
The second row represents the equation . If then this will be an equation that cannot be solved (it will be inconsistent). Therefore, when , the equation is inconsistent and cannot be solved. There is no solution.
On the other hand, if , then the second row is consistent and there are solutions. In fact, there are infinitely many: all those points satisfying .
In parametric vector form, the solution set when can be written:
.
geometric interpretation
For any fixed number , this represents a line parallel to the vector going through the point . All such points in the -plane get mapped to the point on the line in the -plane.
The linear transformation is neither one-to-one nor onto. The null space (kernel) of is a line through the origin parallel to :
We end Section 1.5 by visualizing as a mapping through the use of an animation. The domain of is the -plane on the left and the codomain of is the -plane on the right.
In the animation, the value of changes, and the red point on the right represents a point in the image . In fact, for any fixed value of , the entire red line on the left gets mapped onto that one red point on the right. Note that the coordinates of the black point are and that the components of black vector are .
When , the red dot on the right is at the origin and the entire red line going through the origin on the left is the null space (kernel) of .
This visually emphasizes that the linear transformation is neither one-to-one nor onto.
Basic Exercises
- Graph (in rectangular coordinates) the linear transformation defined by the formula . Is one-to-one? Is onto? Solve the equation . (Yes, this is all supposed to be easy.)
- Graph (in rectangular coordinates) the linear transformation defined by the formula (or ). Is one-to-one? Is onto? Solve the equation (or ). Note the relationships between the answers in #1 and #2.
- Do your best to make a decent graph of the linear transformation defined by the formula (or ). Is one-to-one? Is onto? Solve the equation . Is there a solution? If so, is it unique? Write the answer in parametric vector form if necessary.
Row Operations Exercises
- Let be the linear transformation defined by . Is one-to-one? Is onto? Use elementary row operations to solve the equation . Is there a solution? If so, is it unique? Write the answer in parametric vector form if necessary. Describe the null space (kernel) and image of .
- Answer the same questions as in #4 for .
Challenge Exercises
- Prove Theorem 1.5.3
- Suppose that is defined by . Prove that is a linear transformation if and only if .
Video for Section 1.5
Here is a video overview of the content of this section.