Unit 4: Matrices, Linear Maps and Change of Basis
Total Page:16
File Type:pdf, Size:1020Kb
Unit 4: Matrices, Linear maps and change of basis Juan Luis Melero and Eduardo Eyras September 2018 1 Contents 1 Linear maps3 1.1 Operations of linear maps....................3 1.1.1 Scaling...........................3 1.1.2 Reflection.........................4 1.1.3 Pure rotation.......................4 1.2 Definition of linear map.....................6 1.3 Image of a map..........................6 1.4 Kernel (nullspace) of a map...................8 1.5 Types of maps........................... 10 1.5.1 Monomorphism (injective or one-to-one map)..... 10 1.5.2 Epimorphism (surjective or onto map)......... 11 1.5.3 Isomorphism (bijective or "one-to-one and onto" maps) 11 1.6 Matrix representation of a linear map.............. 13 1.7 Properties of the matrix associated to a linear map, kernel and image............................... 16 1.7.1 Definitions......................... 16 1.7.2 Application of the properties............... 18 2 Change of basis 20 3 Composition of linear maps 22 4 Inverse of a linear map 23 5 Path of linear maps 23 6 Exercises 24 7 R practical 28 7.1 Kernel of a linear map...................... 28 7.2 Image of a linear map...................... 28 2 1 Linear maps 1.1 Operations of linear maps A linear map is an operation on a vector space to transform one vector into another and which can be represented as a matrix multiplication: n m fA : R ! R m ~u !~v = fA(~u) = A~u 2 R For instance, in three dimensions: 0 1 0 1 0 1 a11 a12 a13 u1 v1 ~v = fA(~u) = A~u = @a21 a22 a23A @u2A = @v2A a31 a32 a33 u3 v3 Many operations can be represented with linear maps. We describe below some interesting ones. 1.1.1 Scaling A scaling operation returns a vector in the same direction. The matrices associated to this operation are diagonal matrices. u au a 0 u f(~u) = a~u ! f(~u) = a 1 = 1 = 1 = A~u u2 au2 0 a u2 Figure 1: Example of a scaling operation. The thick arrow represents the original vector, whereas the thin arrow represents the scaled vector. For example: 2 2 0 2 4 ~u = ! f(~u) = A~u = = 1 0 2 1 2 3 1.1.2 Reflection The reflection operation returns a vector mirrored by a given axis. The matrix has the property of being diagonal and such that the square of the matrix is the unit matrix. If the matrix X is a reflection, then 2 A = In For instance: 1 0 u1 u1 ~v = fA(~u) = A~u = = 0 −1 u2 −u2 2 1 0 2 2 ! = 1 0 −1 1 −1 Figure 2: Example of a reflection operation. The thick arrow represents the original vector, whereas the thin arrow represents the reflected vector. 1.1.3 Pure rotation A pure rotation returns the vector rotated with a certain angle. That is, it does not change its norm. Additionally, a rotation does not change the relative angle between vectors, so in particular, it preserves the orthogonality between vectors. 4 It can then be proven (left as exercise) that pure rotation matrices fulfill the T T property AA = A A = In. This is the general definition of an orthonormal matrix (preserves norms and relative angles). In particular, an orthonormal matrix is formed by column or row vectors that mutually orthogonal and have norm (module) 1. For instance, in two dimensions one can show that: 8 a2 + c2 = 1 a b <> A = A−1 = AT ! b2 + d2 = 1 c d :>ab + cd = 0 We can parametrize the matrix with the angle using trigonometric functions. If recall that sin2 θ + cos2 θ = 1, and use the fact that row or column vectors must be orthogonal, we can reparametrize the matrix as: cos θ − sin θ A(θ) = sin θ cos θ cos θ − sin θ u u cos θ − u sin θ ~v = A(θ)~u = 1 = 1 2 sin θ cos θ u2 u1 sin θ + u2 cos θ For example: π 0 1 2 1 θ = ! u~0 = A(π=2)~u = = 2 −1 0 1 −2 Figure 3: Example of pure rotation operation. Here u represents the original vector, whereas u0 represents the rotated vector. 5 1.2 Definition of linear map A map f, also called application or function, is a relation between two vector spaces M; N such that every vector in M has a corresponding vector in N: f : M! N u !f(u) f is a map () 8u; 9!f(u) Such a transformation is a linear map if it fulfills these two properties: 1. u; v 2 M =) f(u + v) = f(u) + f(v) 2 N 2. λ 2 R; u 2 M =) f(λu) = λf(u) 2 N For instance, consider the following map between R2 and R: f : R2 ! R (x; y)!f(x; y) = 2x − y We show property 1. Consider the map on the sum of any two vectors in R2: f((x; y)+(w; z)) = f(x+w; y+z) = 2(x+w)−(y+z) = 2x−y+2w−z = f(x; y)+f(w; z) Similarly, we show property 2: f(λ(x; y)) = f(λx, λy) = 2λx − λy = λ(2x − y) = λf(x; y) 1.3 Image of a map The image of a map is the set of all elements of the target set that are described by the map (given by the map): Im(f) = fw 2 N j 9u 2 M : f(u) = wg ⊆ N As we will see, linear maps can be represented with matrices. In this repre- sentation, the image of a map is the vector subspace generated by the column vectors of the matrix A representing the map: Span(f(a11; a21; : : : ; an1);:::; (a1m; a2m; : : : ; anm)g). 6 Proposition: the image of a linear map is a vector subspace. The proof follows from the definition of linear map. We show that the ele- ments of the Image fulfill the closure (under vector addition and multiplica- tion by scalars) and include the neutral element: 1. 8f(u); f(v) 2 Im(f) ! f(u) + f(v) = f(u + v) 2 Im(f) 2. 8a 2 R; 8f(u) 2 Im(f) ! af(u) = f(au) 2 Im(f) 3. f(u) 2 Im(f) ! f(0) = f(u − u) = f(u) − f(u) 2 Im(f) ! f(0) 2 Im(f) Figure 4: Illustration of the image of a map. Example. In this example we use the fact that a linear map can be repre- sented as a matrix and that the columns of the matrix are the vectors that span the target space. Thus, the number of rows is the dimension of the image (more details on this later). Consider the following linear map: f : R2 ! R3 (x; y)!f(x; y) = (x + y; 2 + y; y − x) We can represent this linear map with the following matrix: 0 1 11 0 1 11 0 x + y 1 x A = 2 1 since 2 1 = 2x + y f @ A @ A y @ A −1 1 −1 1 −x + y 7 The image of the linear map is the span of the column vectors: 2 3 Im(f) = f(R ) = Spanf(1; 2; −1); (1; 1; 1)g ⊆ R The image of this linear map is the set of all the linear combinations of these two vectors. 1.4 Kernel (nullspace) of a map The kernel of a map is the set of the elements which map to the zero (neutral) vector. f : M ! N n o null(f) = f −1(0) = Ker(f) = ~v 2 M j f(~v) = ~0 Proposition: the kernel of a map is a vector space. The proof follows from the definition of linear map: 1. 8u; v 2 Ker(f) ! f(u+v) = f(u)+f(v) = 0+0 = 0 ! u+v 2 Ker(f) 2. 8a 2 R; 8u 2 Ker(f) ! f(au) = af(u) = a · 0 = 0 ! au 2 Ker(f) 3. f(0) = f(u − u) = f(u) − f(u) = 0 − 0 = 0 ! 0 2 Ker(f) Figure 5: Illustration of the kernel of a map. Example: given a linear map, using its associated matrix, we want to find which vectors in the domain set map to the zero vector in the target space. Consider the same linear map as the example of the image (section 1.3). 0 1 11 Af = @ 2 1A −1 1 8 We find those vectors that map to the zero vector: 0 1 11 001 x A ~u = ~0 2 1 = 0 f @ A y @ A −1 1 0 x + y = 0 9 = x = 0 x = 0 2x + y = 0 ! ! x = y y = 0 −x + y = 0 ; The kernel of this linear map is: 0 Ker(f) = 0 0 Let us consider now an example where the Ker(f) is not . Consider the 0 following matrix associated to a linear map: 3 2 f : R ! R 1 1 1 A = 1 −1 −2 0x1 1 1 1 0 y = 1 −1 −2 @ A 0 z x = z=2 9 x + y + z = 0 = ! y = −3z=2 x − y − 2z = 0 z = z ; So the kernel is: 80 1 9 < z=2 = Ker(f) = @−3z=2A ; z 2 R : z ; This the parametric representation of the Kernel as a vector space. We can also represent a vector space as the span of the basis vectors. In the case of this Kernel: Ker(f) = Spanf(1=2; −3=2; 1)g 9 1.5 Types of maps 1.5.1 Monomorphism (injective or one-to-one map) A monomorphism is a linear map which, for different vectors, return different images.