Jump to content

Linear Algebra/Representing Linear Maps with Matrices

From Wikibooks, open books for an open world
Linear Algebra
 ← Computing Linear Maps Representing Linear Maps with Matrices Any Matrix Represents a Linear Map → 
Example 1.1

Consider a map h with domain ℝ2 and codomain ℝ3 (fixing

B=⟨(20),(14)⟩andD=⟨(100),(0−20),(101)⟩

as the bases for these spaces) that is determined by this action on the vectors in the domain's basis.

(20)⟼h(111)(14)⟼h(120)

To compute the action of this map on any vector at all from the domain, we first express h(β→1) and h(β→2) with respect to the codomain's basis:

(111)=0(100)−12(0−20)+1(101)soRepD(h(β→1))=(0−1/21)D

and

(120)=1(100)−1(0−20)+0(101)soRepD(h(β→2))=(1−10)D

(these are easy to check). Then, as described in the preamble, for any member v→ of the domain, we can express the image h(v→) in terms of the h(β→)'s.

h(v→)=h(c1⋅(20)+c2⋅(14))=c1⋅h((20))+c2⋅h((14))=c1⋅(0(100)−12(0−20)+1(101))+c2⋅(1(100)−1(0−20)+0(101))=(0c1+1c2)⋅(100)+(−12c1−1c2)⋅(0−20)+(1c1+0c2)⋅(101)

Thus,

with RepB(v→)=(c1c2) then RepD(h(v→))=(0c1+1c2−(1/2)c1−1c21c1+0c2).

For instance,

with RepB((48))=(12)B then RepD(h((48)))=(2−5/21).

We will express computations like the one above with a matrix notation.

(01−1/2−110)B,D(c1c2)B=(0c1+1c2(−1/2)c1−1c21c1+0c2)D

In the middle is the argument v→ to the map, represented with respect to the domain's basis B by a column vector with components c1 and c2. On the right is the value h(v→) of the map on that argument, represented with respect to the codomain's basis D by a column vector with components 0c1+1c2, etc. The matrix on the left is the new thing. It consists of the coefficients from the vector on the right, 0 and 1 from the first row, −1/2 and −1 from the second row, and 1 and 0 from the third row.

This notation simply breaks the parts from the right, the coefficients and the c's, out separately on the left, into a vector that represents the map's argument and a matrix that we will take to represent the map itself.

Definition 1.2

Suppose that V and W are vector spaces of dimensions n and m with bases B and D, and that h:V→W is a linear map. If

RepD(h(β→1))=(h1,1h2,1⋮hm,1)D…RepD(h(β→n))=(h1,nh2,n⋮hm,n)D

then

RepB,D(h)=(h1,1h1,2…h1,nh2,1h2,2…h2,n⋮hm,1hm,2…hm,n)B,D

is the matrix representation of h with respect to B,D.

Briefly, the vectors representing the h(β→)'s are adjoined to make the matrix representing the map.

RepB,D(h)=(⋮⋮RepD(h(β→1))⋯RepD(h(β→n))⋮⋮)

Observe that the number of columns n of the matrix is the dimension of the domain of the map, and the number of rows m is the dimension of the codomain.

Example 1.3

If h:ℝ3→𝒫1 is given by

(a1a2a3)⟼h(2a1+a2)+(−a3)x

then where

B=⟨(001),(020),(200)⟩andD=⟨1+x,−1+x⟩

the action of h on B is given by

(001)⟼h−x(020)⟼h2(200)⟼h4

and a simple calculation gives

RepD(−x)=(−1/2−1/2)DRepD(2)=(1−1)DRepD(4)=(2−2)D

showing that this is the matrix representing h with respect to the bases.

RepB,D(h)=(−1/212−1/2−1−2)B,D

We will use lower case letters for a map, upper case for the matrix, and lower case again for the entries of the matrix. Thus for the map h, the matrix representing it is H, with entries hi,j.

Theorem 1.4

Assume that V and W are vector spaces of dimensions m and n with bases B and D, and that h:V→W is a linear map. If h is represented by

RepB,D(h)=(h1,1h1,2…h1,nh2,1h2,2…h2,n⋮hm,1hm,2…hm,n)B,D

and v→∈V is represented by

RepB(v→)=(c1c2⋮cn)B

then the representation of the image of v→ is this.

RepD(h(v→))=(h1,1c1+h1,2c2+⋯+h1,ncnh2,1c1+h2,2c2+⋯+h2,ncn⋮hm,1c1+hm,2c2+⋯+hm,ncn)D
Proof

Problem 18.

We will think of the matrix RepB,D(h) and the vector RepB(v→) as combining to make the vector RepD(h(v→)).

Definition 1.5

The matrix-vector product of a m×n matrix and a n×1 vector is this.

(a1,1a1,2…a1,na2,1a2,2…a2,n⋮am,1am,2…am,n)(c1⋮cn)=(a1,1c1+a1,2c2+⋯+a1,ncna2,1c1+a2,2c2+⋯+a2,ncn⋮am,1c1+am,2c2+⋯+am,ncn)

The point of Definition 1.2 is to generalize Example 1.1, that is, the point of the definition is Theorem 1.4, that the matrix describes how to get from the representation of a domain vector with respect to the domain's basis to the representation of its image in the codomain with respect to the codomain's basis. With Definition 1.5, we can restate this as: application of a linear map is represented by the matrix-vector product of the map's representative and the vector's representative.

Example 1.6

With the matrix from Example 1.3 we can calculate where that map sends this vector.

v→=(410)

This vector is represented, with respect to the domain basis B, by

RepB(v→)=(01/22)B

and so this is the representation of the value h(v→) with respect to the codomain basis D.

RepD(h(v→))=(−1/212−1/2−1−2)B,D(01/22)B=((−1/2)⋅0+1⋅(1/2)+2⋅2(−1/2)⋅0−1⋅(1/2)−2⋅2)D=(9/2−9/2)D

To find h(v→) itself, not its representation, take (9/2)(1+x)−(9/2)(−1+x)=9.

Example 1.7

Let π:ℝ3→ℝ2 be projection onto the xy-plane. To give a matrix representing this map, we first fix bases.

B=⟨(100),(110),(−101)⟩D=⟨(21),(11)⟩

For each vector in the domain's basis, we find its image under the map.

(100)⟼π(10)(110)⟼π(11)(−101)⟼π(−10)

Then we find the representation of each image with respect to the codomain's basis

RepD((10))=(1−1)RepD((11))=(01)RepD((−10))=(−11)

(these are easily checked). Finally, adjoining these representations gives the matrix representing π with respect to B,D.

RepB,D(π)=(10−1−111)B,D

We can illustrate Theorem 1.4 by computing the matrix-vector product representing the following statement about the projection map.

π((221))=(22)

Representing this vector from the domain with respect to the domain's basis

RepB((221))=(121)B

gives this matrix-vector product.

RepD(π((221)))=(10−1−111)B,D(121)B=(02)D

Expanding this representation into a linear combination of vectors from D

0⋅(21)+2⋅(11)=(22)

checks that the map's action is indeed reflected in the operation of the matrix. (We will sometimes compress these three displayed equations into one

(221)=(121)B⟼Hh(02)D=(22)

in the course of a calculation.)

We now have two ways to compute the effect of projection, the straightforward formula that drops each three-tall vector's third component to make a two-tall vector, and the above formula that uses representations and matrix-vector multiplication. Compared to the first way, the second way might seem complicated. However, it has advantages. The next example shows that giving a formula for some maps is simplified by this new scheme.

Example 1.8

To represent a rotation map tθ:ℝ2→ℝ2 that turns all vectors in the plane counterclockwise through an angle θ

we start by fixing bases. Using ℰ2 both as a domain basis and as a codomain basis is natural, Now, we find the image under the map of each vector in the domain's basis.

(10)⟼tθ(cos⁡θsin⁡θ)(01)⟼tθ(−sin⁡θcos⁡θ)

Then we represent these images with respect to the codomain's basis. Because this basis is ℰ2, vectors are represented by themselves. Finally, adjoining the representations gives the matrix representing the map.

Repℰ2,ℰ2(tθ)=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)

The advantage of this scheme is that just by knowing how to represent the image of the two basis vectors, we get a formula that tells us the image of any vector at all; here a vector rotated by θ=π/6.

(3−2)⟼tπ/6(3/2−1/21/23/2)(3−2)≈(3.598−0.232)

(Again, we are using the fact that, with respect to ℰ2, vectors represent themselves.)

We have already seen the addition and scalar multiplication operations of matrices and the dot product operation of vectors. Matrix-vector multiplication is a new operation in the arithmetic of vectors and matrices. Nothing in Definition 1.5 requires us to view it in terms of representations. We can get some insight into this operation by turning away from what is being represented, and instead focusing on how the entries combine.

Example 1.9

In the definition the width of the matrix equals the height of the vector. Hence, the first product below is defined while the second is not.

(100431)(102)=(16)(100431)(10)

One reason that this product is not defined is purely formal: the definition requires that the sizes match, and these sizes don't match. Behind the formality, though, is a reason why we will leave it undefined— the matrix represents a map with a three-dimensional domain while the vector represents a member of a two-dimensional space.

A good way to view a matrix-vector product is as the dot products of the rows of the matrix with the column vector.

(⋮ai,1ai,2…ai,n⋮)(c1c2⋮cn)=(⋮ai,1c1+ai,2c2+…+ai,ncn⋮)

Looked at in this row-by-row way, this new operation generalizes dot product.

Matrix-vector product can also be viewed column-by-column.

(h1,1h1,2…h1,nh2,1h2,2…h2,n⋮hm,1hm,2…hm,n)(c1c2⋮cn)=(h1,1c1+h1,2c2+⋯+h1,ncnh2,1c1+h2,2c2+⋯+h2,ncn⋮hm,1c1+hm,2c2+⋯+hm,ncn)=c1(h1,1h2,1⋮hm,1)+⋯+cn(h1,nh2,n⋮hm,n)
Example 1.10
(10−1203)(2−11)=2(12)−1(00)+1(−13)=(17)

The result has the columns of the matrix weighted by the entries of the vector. This way of looking at it brings us back to the objective stated at the start of this section, to compute h(c1β→1+⋯+cnβ→n) as c1h(β→1)+⋯+cnh(β→n).

We began this section by noting that the equality of these two enables us to compute the action of h on any argument knowing only h(β→1), ..., h(β→n). We have developed this into a scheme to compute the action of the map by taking the matrix-vector product of the matrix representing the map and the vector representing the argument. In this way, any linear map is represented with respect to some bases by a matrix. In the next subsection, we will show the converse, that any matrix represents a linear map.


Exercises

[edit | edit source]
This exercise is recommended for all readers.
Problem 1

Multiply the matrix

(1310−12110)

by each vector (or state "not defined").

  1. (210)
  2. (−2−2)
  3. (000)
Problem 2

Perform, if possible, each matrix-vector multiplication.

  1. (213−1/2)(42)
  2. (110−210)(131)
  3. (11−21)(131)
This exercise is recommended for all readers.
Problem 3

Solve this matrix equation.

(2110131−12)(xyz)=(844)
This exercise is recommended for all readers.
Problem 4

For a homomorphism from 𝒫2 to 𝒫3 that sends

1↦1+x,x↦1+2x,andx2↦x−x3

where does 1−3x+2x2 go?

This exercise is recommended for all readers.
Problem 5

Assume that h:ℝ2→ℝ3 is determined by this action.

(10)↦(220)(01)↦(01−1)

Using the standard bases, find

  1. the matrix representing this map;
  2. a general formula for h(v→).
This exercise is recommended for all readers.
Problem 6

Let d/dx:𝒫3→𝒫3 be the derivative transformation.

  1. Represent d/dx with respect to B,B where B=⟨1,x,x2,x3⟩.
  2. Represent d/dx with respect to B,D where D=⟨1,2x,3x2,4x3⟩.
This exercise is recommended for all readers.
Problem 7

Represent each linear map with respect to each pair of bases.

  1. d/dx:𝒫n→𝒫n with respect to B,B where B=⟨1,x,…,xn⟩, given by
    a0+a1x+a2x2+…+anxn↦a1+2a2x+…+nanxn−1
  2. ∫:𝒫n→𝒫n+1 with respect to Bn,Bn+1 where Bi=⟨1,x,…,xi⟩, given by
    a0+a1x+a2x2+…+anxn↦a0x+a12x2+…+ann+1xn+1
  3. ∫01:𝒫n→ℝ with respect to B,ℰ1 where B=⟨1,x,…,xn⟩ and ℰ1=⟨1⟩, given by
    a0+a1x+a2x2+…+anxn↦a0+a12+…+ann+1
  4. eval3:𝒫n→ℝ with respect to B,ℰ1 where B=⟨1,x,…,xn⟩ and ℰ1=⟨1⟩, given by
    a0+a1x+a2x2+…+anxn↦a0+a1⋅3+a2⋅32+…+an⋅3n
  5. slide−1:𝒫n→𝒫n with respect to B,B where B=⟨1,x,…,xn⟩, given by
    a0+a1x+a2x2+…+anxn↦a0+a1⋅(x+1)+…+an⋅(x+1)n
Problem 8

Represent the identity map on any nontrivial space with respect to B,B, where B is any basis.

Problem 9

Represent, with respect to the natural basis, the transpose transformation on the space ℳ2×2 of 2×2 matrices.

Problem 10

Assume that B=⟨β→1,β→2,β→3,β→4⟩ is a basis for a vector space. Represent with respect to B,B the transformation that is determined by each.

  1. β→1↦β→2, β→2↦β→3, β→3↦β→4, β→4↦0→
  2. β→1↦β→2, β→2↦0→, β→3↦β→4, β→4↦0→
  3. β→1↦β→2, β→2↦β→3, β→3↦0→, β→4↦0→
Problem 11

Example 1.8 shows how to represent the rotation transformation of the plane with respect to the standard basis. Express these other transformations also with respect to the standard basis.

  1. the dilation map ds, which multiplies all vectors by the same scalar s
  2. the reflection map fℓ, which reflects all all vectors across a line ℓ through the origin
This exercise is recommended for all readers.
Problem 12

Consider a linear transformation of ℝ2 determined by these two.

(11)↦(20)(10)↦(−10)
  1. Represent this transformation with respect to the standard bases.
  2. Where does the transformation send this vector?
    (05)
  3. Represent this transformation with respect to these bases.
    B=⟨(1−1),(11)⟩D=⟨(22),(−11)⟩
  4. Using B from the prior item, represent the transformation with respect to B,B.
Problem 13

Suppose that h:V→W is nonsingular so that by Theorem II.2.21, for any basis B=⟨β→1,…,β→n⟩⊂V the image h(B)=⟨h(β→1),…,h(β→n)⟩ is a basis for W.

  1. Represent the map h with respect to B,h(B).
  2. For a member v→ of the domain, where the representation of v→ has components c1, ..., cn, represent the image vector h(v→) with respect to the image basis h(B).
Problem 14

Give a formula for the product of a matrix and e→i, the column vector that is all zeroes except for a single one in the i-th position.

This exercise is recommended for all readers.
Problem 15

For each vector space of functions of one real variable, represent the derivative transformation with respect to B,B.

  1. {acos⁡x+bsin⁡x|a,b∈ℝ}, B=⟨cos⁡x,sin⁡x⟩
  2. {aex+be2x|a,b∈ℝ}, B=⟨ex,e2x⟩
  3. {a+bx+cex+dxex|a,b,c,d∈ℝ}, B=⟨1,x,ex,xex⟩
Problem 16

Find the range of the linear transformation of ℝ2 represented with respect to the standard bases by each matrix.

  1. (1000)
  2. (0032)
  3. a matrix of the form (ab2a2b)
This exercise is recommended for all readers.
Problem 17

Can one matrix represent two different linear maps? That is, can RepB,D(h)=RepB̂,D̂(ĥ)?

Problem 18

Prove Theorem 1.4.

This exercise is recommended for all readers.
Problem 19

Example 1.8 shows how to represent rotation of all vectors in the plane through an angle θ about the origin, with respect to the standard bases.

  1. Rotation of all vectors in three-space through an angle θ about the x-axis is a transformation of ℝ3. Represent it with respect to the standard bases. Arrange the rotation so that to someone whose feet are at the origin and whose head is at (1,0,0), the movement appears clockwise.
  2. Repeat the prior item, only rotate about the y-axis instead. (Put the person's head at e→2.)
  3. Repeat, about the z-axis.
  4. Extend the prior item to ℝ4. (Hint: "rotate about the z-axis" can be restated as "rotate parallel to the xy-plane".)
Problem 20 (Schur's Triangularization Lemma)
  1. Let U be a subspace of V and fix bases BU⊆BV. What is the relationship between the representation of a vector from U with respect to BU and the representation of that vector (viewed as a member of V) with respect to BV?
  2. What about maps?
  3. Fix a basis B=⟨β→1,…,β→n⟩ for V and observe that the spans
    [{0→}]={0→}⊂[{β→1}]⊂[{β→1,β→2}]⊂⋯⊂[B]=V
    form a strictly increasing chain of subspaces. Show that for any linear map h:V→W there is a chain W0={0→}⊆W1⊆⋯⊆Wm=W of subspaces of W such that
    h([{β→1,…,β→i}])⊂Wi
    for each i.
  4. Conclude that for every linear map h:V→W there are bases B,D so the matrix representing h with respect to B,D is upper-triangular (that is, each entry hi,j with i>j is zero).
  5. Is an upper-triangular representation unique?

Solutions

Linear Algebra
 ← Computing Linear Maps Representing Linear Maps with Matrices Any Matrix Represents a Linear Map →