The following example of a linear map between coordinate spaces is essential for the rest of this chapter.
Let #m# and #n# be natural numbers and #A# a real #(m\times n)#-matrix. We write elements of #\mathbb{R}^n# and #\mathbb{R}^m# as columns.
Define the map #L_A: \mathbb{R}^n \rightarrow \mathbb{R}^m# by
\[
L_A(\vec{x}) = A\vec{x}
\] This map is linear.
We call #L_A# the linear map determined by #A#.
If #m=n=1# and #A=\matrix{a}#, then #L_A# is the map #\mathbb{R} \rightarrow \mathbb{R}# given by
\[
L_A(x) = a\cdot x
\] Thus, left multiplication by a number #a# is a linear map #\mathbb{R} \rightarrow \mathbb{R}#.
If
\[
A=\matrix{ 1 & -1 & 2 \\ 1 & -1 & 2 }
\] then
- the image of the vector #\cv{3\\ 1\\ 1}# under #L_A# equals #\matrix{ 1 & -1 & 2 \\ 1 & -1 & 2 }\cv{3\\ 1\\ 1}= \cv{4\\ 4}#;
- the image of #5 \cdot \cv{3\\ 1\\ 1}# under #L_A# equals #5\cdot \cv{4\\ 4}=\cv{20\\ 20}# thanks to the linearity of #L_A#.
We will see later that any linear map between two coordinate spaces can be written as the linear map of a matrix.
If #\vec{x}# and #\vec{y}# are two elements of #\mathbb{R}^n#, then the rules of matrix multiplication show that for all scalars #\alpha# and #\beta# the following holds:
\[\begin{array}{rcl}L_A(\alpha \vec{x} + \beta \vec{y}) &=& A(\alpha \vec{x} + \beta \vec{y}) \\ &&\phantom{xxx}\color{blue}{\text{definition of }L_A}\\ &=&\alpha A\vec{x} + \beta A\vec{y}\\ &&\phantom{xxx}\color{blue}{\text{linearity of matrix multiplication}}\\ &=& \alpha L_A(\vec{x}) + \beta L_A (\vec{y}) \\ &&\phantom{xxx}\color{blue}{\text{definition of }L_A}\end{array}\]
This shows that #L_A# is linear.
The standard dot product, which we define below for all vector spaces #\mathbb{R}^n#, allows us to obtain a good interpretation of matrices with a single row.
The standard dot product on #\mathbb{R}^n# is defined as the map that adds to two vectors #\vec{x}=\rv{x_1,\ldots,x_n}# and #\vec{y}=\rv{y_1,\ldots,y_n}# the number
\[\dotprod{\vec{x}}{\vec{y}} = x_1\cdot y_1+\cdots +x_n\cdot y_n\]
The vectors \(\vec{x}\) and \(\vec{y}\) are called orthogonal if \(\dotprod{\vec{x}}{\vec{y}} =0\). The length of the vector #\vec{x}# is the number #\sqrt{\dotprod{\vec{x}}{\vec{x}}}#.
Now choose #\vec{a}\in\mathbb{R}^n# fixed.
- The map that assigns to #\vec{x}# in #\mathbb{R}^n# the number \(\dotprod{\vec{x}}{\vec{a}}\) is a linear map #\mathbb{R}^n\to\mathbb{R}#.
- If #\vec{a}# is not the origin, then there is a unique linear map #P_\ell# which maps each point of the line #\ell=\linspan{\vec{a}}# through the origin onto itself, and each vector orthogonal to #\vec{a}# onto the origin. The map #P_\ell# is called the orthogonal projection on #\ell# and has the mapping rule
\[
P_\ell(\vec{x}) =\frac{\dotprod{\vec{x}}{\vec{a}}}{\dotprod{\vec{a}}{\vec{a}}}\cdot\vec{a}
\]
If #n=2# or #n=3# then \(\dotprod{\vec{x}}{\vec{y}}\) is the familiar standard dot product of #\vec{x}# and #\vec{y}#.
The map that assigns to #\vec{x}# in #\mathbb{R}^n# the number \(\dotprod{\vec{x}}{\vec{a}}\) is the linear map #L_A# determined by the #(1\times n)#-matrix #A = \matrix{a_1&a_2&\cdots &a_n}#.
In order to derive the mapping rule for #P_\ell# we assume #\vec{x}\in\mathbb{R}^n#. Suppose we can write #\vec{x}# as the sum of a scalar multiple #\lambda \cdot\vec{a}# of #\vec{a}# and a vector #\vec{u}# perpendicular to #\vec{a}#: \[\vec{x} = \lambda\cdot\vec{a}+\vec{u}\]
Linearity of the standard dot product with #\vec{a}# then gives \[\dotprod{\vec{a}}{\vec{x}}=\lambda\cdot(\dotprod{\vec{a}}{\vec{a}})+\dotprod{\vec{a}}{\vec{u}}=\lambda\cdot(\dotprod{\vec{a}}{\vec{a}})\] so the assumption #\vec{a}\neq\vec{0}# allows us to write
\[\lambda = \frac{\dotprod{\vec{a}}{\vec{x}}}{\dotprod{\vec{a}}{\vec{a}}}\]
Choosing this value for #\lambda# and #\vec{u}=\vec{x}-\lambda\cdot\vec{a}# indeed allows us to write #\vec{x}# as a sum of the scalar multiple #\lambda\cdot\vec{a}# of #\vec{a}# and a vector #\vec{u}# orthogonal to #\vec{a}#. This means that we can determine the mapping rule for #P_\ell#:
\[\begin{array}{rcl} P_\ell(\vec{x}) &=& P_\ell(\lambda\cdot\vec{a}+\vec{u})\\&&\phantom{xxx}\color{blue}{\text{found decomposition of }\vec{x}}\\ &=& \lambda\cdot P_\ell(\vec{a})+P_\ell(\vec{u})\\ &&\phantom{xxx}\color{blue}{\text{linearity of }P_\ell}\\ &=& \lambda\cdot \vec{a}\\&&\phantom{xxx}\color{blue}{\vec{a}\in\ell\text{ and }\vec{u} \text{ is perpendicular to }\vec{a}}\\&=&\dfrac{\dotprod{\vec{a}}{\vec{x}}}{\dotprod{\vec{a}}{\vec{a}}}\cdot \vec{a}\\&&\phantom{xxx}\color{blue}{\text{found expression for }\lambda}\\\end{array}\]
The definition of #P_{\ell}# does not depend on the choice of #\vec{a}# on the line #\ell# as long as it is unequal to the origin: replacing #\vec{a}# by another vector #\mu\vec{a}# on #\ell# where #\mu# is a scalar unequal to #0# shows
\[\frac{\dotprod{\vec{x}}{(\mu\vec{a})} }{\dotprod{(\mu\vec{a})}{(\mu\vec{a})}}\cdot(\mu\vec{a})=\frac{\dotprod{\vec{x}}{\vec{a}}}{\dotprod{\vec{a}}{\vec{a}}}\cdot\vec{a}=P_\ell(\vec{x})\]
In particular, we may choose #\dotprod{\vec{a}}{\vec{a}}# (which is positive when #\vec{a}# is not the origin) to be equal to #1#, in which case #P_\ell(\vec{x})=\left(\dotprod{\vec{x}}{\vec{a}}\right)\vec{a}#.
A similar expression exists for the orthogonal projection #P_U# on an arbitrary linear subspace #U# of #\mathbb{R}^n#, the linear mapping sending each vector in #U# to itself and each vector in #U^\perp# to the zero vector. If #\basis{\vec{a}_1, \ldots , \vec{a}_k}# is an orthonormal basis of the subspace #U# (meaning #\dotprod{\vec{a}_i}{ \vec{a}_j}# is equal to #0# for #i\ne j# and equal to #1# for #i=j#) then the orthogonal projection #P_U# satisfies:
\[
P_U(\vec{x}) = (\dotprod{\vec{x}}{\vec{a}_1})\vec{a}_1 +\cdots +
(\dotprod{\vec{x}}{\vec{a}_k})\vec{a}_k
\]
The linear map #L:\mathbb{R}^2\to\mathbb{R}^2# defined by
\[ L\left(\rv{x,y}\right) = \rv{2 x-3 y,4 y+5 x}\] is defined by a matrix #A#.
Which matrix?
#A =# #\matrix{2 & -3 \\ 5 & 4 \\ }#
The fact that #L# is determined by a matrix #A# means #L = L_A#. The matrix #A=\matrix{a&b\\ c & d}# must therefore satisfy \[\matrix{a&b\\ c & d}\cv{x\\ y} =\matrix{2 x-3 y \\ 4 y+5 x}\] Element by element comparison gives
\[\eqs{a\cdot x+ b\cdot y &=& 2 x-3 y\\ c\cdot x+ d\cdot y &=& 4 y+5 x}\]
It follows that #a = 2#, #b = -3#, #c = 5#, and #d=4#, so
\[ A = \matrix{2 & -3 \\ 5 & 4 \\ }\]