MATH 2121 — Linear algebra (Fall 2017) Lecture 7
1 Last time: one-to-one and onto linear transformations
Let T : Rn → Rm be a function.
The following mean the same thing:
• T is linear is the sense that T (u + v) + T (u) + T (v) and T (cv) = cT (v) for u, v ∈ Rn , c ∈ R.
• There is an m × n matrix A such that T has the formula T (v) = Av for v ∈ Rn .
If we are given a linear transformation T , then T (v) = Av for the matrix
A = T (e1 ) T (e2 ) . . . T (en )
where ei ∈ Rn is the vector with a 1 in row i and 0 in all other rows.
Call A the standard matrix of T .
The following all mean the same thing for a function f : X → Y .
• f is one-to-one.
• If a, b ∈ X and f (a) = f (b) then a = b.
• If a, b ∈ X and a 6= b then f (a) 6= f (b).
• f does not send different inputs to the same output.
Similarly, the following all mean the same thing for a function f : X → Y .
• f is onto.
• The range of f is equal to the codomain, i.e., range(f ) = {f (a) : a ∈ X} = Y .
• For each y ∈ Y there is at least one x ∈ X with f (x) = y.
• Every element of the codomain of f is an output for some input.
We can detect whether a linear transformation is one-to-one or onto by inspecting the columns of its
standard matrix (and row reducing).
Theorem. Suppose T : Rn → Rm is the linear transformation T (v) = Av where A is an m × n matrix.
(1) T is one-to-one if and only if the columns of A are linearly independent, which happens precisely
when A has a pivot position in every column.
(2) T is onto if and only if the span of the columns of A is Rm , which happens precisely when A has a
pivot position in every row.
1
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
Example. Let T : R2 → R2 be the linear transformation T (v) = Av. If A is one of the following
matrices, then T is onto and one-to-one.
Standard matrix of T Picture Description of T
1 0
Reflect across the x-axis
0 −1
−1 0
Reflect across y-axis
0 1
0 1
Reflect across y = x
1 0
k 0
(0 < k < 1) Horizontal contraction
0 1
1 0
(k > 0) Vertical sheering
k 1
2 Operators on linear transformations and matrices
Today’s story begins with the observation that linear transformations Rn → Rm are uniquely represented
by m × n matrices, and every m × n matrix corresponds to a linear transformation Rn → Rm .
There are several simple, natural operations we can use to combine and alter linear transformations to get
other linear transformations. The goal is to translate these function operations into matrix operations.
2
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
Sums and scalar multiples. Suppose T : Rn → Rm and U : Rn → Rm are two linear functions with
the same domain and codomain. Their sum T + U is the function Rn → Rm defined by
(T + U )(v) = T (v) + U (v) for v ∈ Rn .
If c ∈ R is a scalar, then cT is the function Rn → Rm defined by
(cT )(v) = cT (v) for v ∈ Rn .
Fact. Both T + U and cT are linear transformations.
Proof. To see that T + U is linear, we check that
(T + U )(u + v) = T (u + v) + U (u + v) = T (u) + T (v) + U (u) + U (v) = (T + U )(u) + (T + U )(v)
for u, v ∈ Rn , and
(T + U )(av) = T (av) + U (av) = aT (v) + aU (v) = a(T + U )(v)
n
for a ∈ R and v ∈ R . Since these properties hold, T + U is linear.
The proof that cT is linear is similar. (Try this yourself!)
Since sums and scalar multiples of linear functions are linear, it follows that differences and arbitrary
linear combinations of linear functions are linear.
Suppose T and U have standard matrices
a11 a12 . . . a1n b11 b12 ... b1n
a21 a22 a2n b21 b22 b2n
A= and B=
.. . . .. .. .. ..
. . . . . .
am1 am2 . . . amn bm1 bm2 ... bmn
so that T (v) = Av and U (v) = Bv.
Proposition. The standard matrix of T + U is
a11 + b11 a12 + b12 ... a1n + b1n
a21 + b21 a22 + b22 a2n + b2n
A+B = .
.. .. ..
. . .
am1 + bm1 am2 + bm2 ... amn + bmn
The standard matrix of cT is
ca11 ca12 ... ca1n
ca21 ca22 ca2n
cA = .
.. .. ..
. . .
cam1 cam2 ... camn
This is how we define sums and scalar multiples of matrices. Note that these operations work in essentially
the same way as for vectors: we can add matrices of the same size, by adding the entries in corresponding
positions together, and we can multiply a matrix by a scalar c by multiplying all entries by c.
Example. We have
4 0 5 1 1 1 5 1 6
+ = .
−1 3 2 3 5 7 2 8 9
and
4 0 5 1 1 1 −4 0 −5 2 2 2 −2 2 −3
− +2 = + = .
−1 3 2 3 5 7 1 −3 −2 6 10 14 7 7 12
3
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
Suppose T, U, V are linear transformations Rn → Rm with standard matrices A, B, C. Let a, b ∈ R.
The following properties then hold:
Functions Matrices
1. T + U = U + V A + B = B + A.
2. (T + U ) + V = T + (U + V ) (A + B) + C = A + (B + C).
3. T + 0 = T where 0 : Rn → Rm is the map 0(v) = 0 ∈ Rm . A + 0 = A.
4. a(T + U ) = aT + aU a(A + B) = aA + aB.
5. (a + b)T = aT + bT (a + b)A = aA + bA.
6. a(bT ) = (ab)T . a(bA) = (ab)A.
Composition. Suppose U : Rn → Rm and T : Rm → Rk are linear.
Note that we assume the codomain of U is equal to the domain of T .
The composition T ◦ U is the function Rn → Rk given by
(T ◦ U )(v) = T (U (v)) for v ∈ Rn .
Fact. Since T and U are linear, T ◦ U is linear.
Proof. To see that T ◦ U is linear, we check that
(T ◦ U )(u + v) = T (U (u + v)) = T (U (u) + U (v)) = T (U (u)) + T (U (v)) = (T ◦ U )(u) + (T ◦ U )(v)
for u, v ∈ Rn , and
(T ◦ U )(cv) = T (U (cv)) = T (cU (v)) = cT (U (v)) = c(T ◦ U )(v)
for c ∈ R and v ∈ Rn .
Important note: U ◦ T is not defined unless k = n.
Even if k = n so that both T ◦ U and U ◦ T are defined, there is no reason to expect that T ◦ U = U ◦ T .
Example. If n = m = k = 1 and T (x) = 2x and U (x) = x2 , then
(T ◦ U )(x) = T (x2 ) = 2x2 but (U ◦ T )(x) = U (2x) = 4x2 .
Since T ◦ U is a linear transformation Rn → Rk , there is a unique k × n matrix C such that
(T ◦ U )(v) = Cv for v ∈ Rn .
If A is the standard matricx of T and B is the standard matrix of U , then we define the matrix product
AB = C.
Note how this definition works: if A is k × m and B is m × n then we define AB to be the unique k × n
matrix C such that Cv = A(Bv) for all v ∈ Rn .
How do we actually compute the rectangular array which is AB, from A and B?
Theorem. Suppose B has columns b1 , b2 , . . . , bn ∈ Rm so that B = b1 b2 ... bn .
Then AB = Ab1 Ab2 . . . Abn .
4
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
Note that this makes sense as A is k × m.
Proof. AB is the standard matrix of the linear function T ◦ U , so
AB = (T ◦ U )(e1 ) (T ◦ U )(e2 ) · · · (T ◦ U )(en ) = A(Be1 ) A(Be2 ) · · · A(Ben )
= Ab1 Ab2 · · · Abn .
2 3 4 3 6 4 3 6
Example. If A = and B = , then b1 = , b2 = , b3 = , so
1 −5 1 −2 3 1 −2 3
11 0 21
AB = Ab1 Ab2 Ab3 = .
−1 13 −9
The quick rule for computing AB: if the ith row of A and jth column of B are
b1
b2
a1 a2 . . . am and
..
.
bm
then the entry in the ith row and jth column of AB is
b1
b2
a1 a2 . . . am . = a1 b1 + a2 b2 + · · · + am bm .
..
bm
1 2 3
1 2 3 4 4 5 6
Example. Suppose A = and B = .
5 6 7 8 7 8 9
9 9 9
The entry in the 2nd row and 2nd column of AB is
5 · 2 + 6 · 5 + 7 · 8 + 8 · 9 = 10 + 30 + 56 + 72 = 168.
Write In for the n × n matrix
1
1
In =
..
.
1
which has 1 in each diagonal position, and zeros in all other positions.
The matrix In is the standard matrix of the identity map Rn → Rn .
This is the linear function T with T (v) = v for all v ∈ Rn .
Proposition. Let A, B, C be matrices.
Assume A is m × n, B is n × l, and C is l × k.
Then A(BC) = (AB)C.
5
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
Proof. Use our first definition of matrix multiplication.
By this definition, AB and BC are the unique matrices such that (AB)x = A(Bx) and (BC)x = B(Cx).
In turn, A(BC) is the unique matrix such that (A(BC))x = A((BC)x) = A(B(Cx)).
But (AB)C is also the unique matrix such that ((AB)C)x = (AB)(Cx) = A(B(Cx)).
Therefore A(BC) = (AB)C.
Here are some easier properties. Suppose A, B, C are matrices and r ∈ R.
• If A is m × n and B, C are n × l then A(B + C) = AB + AC.
• If A, B are m × n and C is n × l then (A + B)C = AC + BC.
• If A is m × n and B is n × l then r(AB) = (rA)B = A(rB).
• If A is m × n then Im A = AIn = A.
3 Pathologies of matrix multiplication
Suppose A and B are matrices.
Four important observations:
1. The product AB is defined only if the number of columns of A is the number of rows of B.
2. Even if AB and BA are both defined, it typically happens that AB 6= BA.
3. AB = AC does not imply B = C.
0 ··· 0
.. . . .. even if both A 6= 0 and B 6= 0.
4. It can happen that AB = 0 = . . .
0 ··· 0
Example. We have
1 0 0 0 1 0 0 1 0 0 0 0
= =
1 0 1 1 1 0 1 1 0 1 0 0
while
0 0 1 0 0 0 1 0 0 0 0 0
= = .
1 1 1 0 1 1 1 1 1 0 2 0
If A and B are both square matrices of the same size (meaning they have the same number of rows and
columns), and AB = BA, then we say that A and B commutes.
4 Matrix transpose
The transpose of an m × n matrix A is the n × m matrix AT whose columns are the rows of A.
If aij is the entry in row i and column j of A, then this is the entry in row j and column i of AT .
a d
a b c
For example, if A = and AT = b e .
d e f
c f
The transpose of A is given by flipping A across the main diagonal, in order to interchange rows/columns.
6
MATH 2121 — Linear algebra (Fall 2017) Lecture 7
1 −3 0
1 1 1 1 1
T 5 0
Another example: if C = −3 5 −2 7 then C = .
1 −2 1
0 0 1 0
1 7 0
We finish this lecture by noting some basic properties of the transpose operation:
• (AT )T = A since flipping twice does nothing.
• If A and B have the same size the (A + B)T = AT + B T .
• If c ∈ R then (cA)T = c(AT ).
• If A is an k × m matrix and B is and m × n matrix then (AB)T = B T AT .
To prove the last property, use our earlier results to compute the entries in ith row and jth column of
the matrices on either side (in terms of the entries of A and B), and check that these are equal.
Question for later: how is the linear transformation with standard matrix A related to the linear trans-
formation with standard matrix AT ? What is the transpose as an operation on linear transformations?