Here we demonstrate that compositions of linear maps are themselves linear maps again. We first define what we mean exactly by a composite map and when such a construction makes sense.

Let #U#, #V#, and #W# be vector spaces and suppose # L: V\rightarrow W# and #M: U\rightarrow V# are maps.

The **composite map** #L\, M: U\rightarrow W# is defined by

\[

L\,M (\vec{u})= L (M (\vec{u}))\hbox{ for all }\vec{u}\in U

\]

If #W=V#, then we write #L^2=L\,L# and, for each natural number #n>1# also #L^n=L\, L^{n-1}#.

Take a vector #\vec{u}\in U#. Applying #M# first brings us to the vector #M (\vec{u})# of #V#. On this vector we can subsequently apply #L#; this brings us to the vector #L(M(\vec{u}))# of #W#. Schematically: \[\begin{array}{lccccc} \text{space:}&U&\rightarrow& V&\rightarrow& W \\ \text{map:}&&M&&L&\\ \text{vector:}&\vec{u}&\mapsto&M(\vec{u})&\mapsto&L(M(\vec{u}))\end{array}\]

The notation #L\, M# suggests that we may view the composite map as a "product'' of the linear maps #L# and #M#. That is only partly true. The existence of #L\, M# does not imply that #M\, L# exists as well; indeed #M\, L# does not exist when #U\neq W#. If #U=W# then #L \,M: W\rightarrow W# and #M\, L: V\rightarrow V# both exist, but in general they are distinct from each other, even when #V=W#.

If the composition of #L# and #M# and the composition of #M# and #L# both exist, then #L\, M = M \,L# is not necessarily true. Let #V# be the vector space of infinitely differentiable functions and define #L: V\rightarrow V# and #M: V\rightarrow V# by

\[

\begin{array}{rcl}

L \ f(x)&=&x\cdot f(x)\\ &\text{and}& \\

M \ f(x)&=&f'(x)

\end{array}

\]

Verify for yourself that these are linear maps. Then

\[

\begin{array}{rcl}

L\, M f(x)&=&x \cdot f'(x) \\ &\text{and}& \\

M\, L f(x)&=&f(x)+x\cdot f'(x)\\

\end{array}

\]

We see that #L\, M \neq M \, L# (for example, substitute the function #f(x)=1#).

Composition is, as we have seen, not commutative. But it is associative: for every three maps #L: V\rightarrow W#, #M: U\rightarrow V#, and #N: X\rightarrow U# we have \[\left(L\, M\right)\, N = L\,\left(M\, N\right)\]

This follows from the fact that both members, applied to #x\in X#, are equal to #L(M(N(x)))#.

As a result of this identity we usually just write \(L\,M\,N\) for the composition.

That concludes the definition of the composition of two maps. In the case of linear maps the linearity is maintained in compositions:

If #L: V\rightarrow W# and #M: U\rightarrow V# are linear maps, the composite map #L\, M# is linear as well.

To prove this, we verify that the composite map #L\, M# respects the summation of the vectors #\vec{u}_1# and #\vec{u}_2#, and the multiplication by a scalar #\alpha# of a vector #\vec{u}#:

\[

\begin{array}{rcl}

L\, M (\vec{u}_1+\vec{u}_2) & =& L(M (\vec{u}_1+\vec{u}_2))\\ &&\phantom{xx}\color{blue}{\text{definition of composition}}\\

& =& L(M (\vec{u}_1)+ M (\vec{u}_2))\\ &&\phantom{xx}\color{blue}{\text{linearity of }M}\\ & =& L(M (\vec{u}_1))+ L (M (\vec{u}_2))\\ &&\phantom{xx}\color{blue}{\text{linearity of }L}\\

& = &L \, M (\vec{u}_1)+L\, M (\vec{u}_2)\\ &&\phantom{xx}\color{blue}{\text{twice definition of composition}}\\ \\

L\, M (\alpha\cdot\vec{u}) & =& L(M (\alpha\cdot\vec{u}))\\ &&\phantom{xx}\color{blue}{\text{definition of composition}}\\ &=& L

(\alpha\cdot M( \vec{u}))\\ && \phantom{xx}\color{blue}{\text{linearity of }M}\\ &=& \alpha\cdot L ( M (\vec{u}))\\ &&\phantom{xx}\color{blue}{\text{linearity of }L}\\ &=& \alpha\cdot L\, M (\vec{u})\\ &&\phantom{xx}\color{blue}{\text{definition of composition}}

\end{array}

\]

Multiplication #L_a# by a fixed number #a# is a linear map. If #a# and #b# are numbers, then the composition #L_a\,L_b# equals #L_{a\cdot b}#. After all, for each number #c# we have

\[\begin{array}{rcl} L_aL_b(c) &=& L_a(L_b(c)) \\ &&\phantom{xx}\color{blue}{\text{definition of composition}}\\ &=& L_a(b\cdot c)\\&&\phantom{xx}\color{blue}{\text{definition }L_b}\\ & = &a\cdot (b\cdot c) \\&&\phantom{xx}\color{blue}{\text{definition of }L_a}\\ &=& (a\cdot b)\cdot c\\ &&\phantom{xx}\color{blue}{\text{associativity of multiplication}}\\ &=& L_{a\cdot b}(c)\\ &&\phantom{xx}\color{blue}{\text{definition of }L_{a\cdot b}} \end{array}\]

In this case, the composition is commutative: #L_a\,L_b=L_b\,L_a#. This is, however, the exception and not the rule.

In the important example of *linear maps defined by matrices* the composition comes down to the linear map defined by the *matrix product*:

Let #m#, #p#, #q# be natural numbers, #A# a #(q\times m)#-matrix and #B# an #(m\times p)#-matrix.

Then, the composite map #L_AL_B# of #L_B:\mathbb{R}^p\to\mathbb{R}^m# and #L_A:\mathbb{R}^m\to\mathbb{R}^q# equals the linear map #L_{AB}:\mathbb{R}^p \rightarrow\mathbb{R}^q# determined by the matrix product #AB#.

For each vector #\vec{x}\in\mathbb{R}^p# the image #L_B\vec{x}# is equal to the matrix product #B\vec{x}\in\mathbb{R}^m#, and for each vector #\vec{y}\in\mathbb{R}^m# the image #L_A\vec{y}# is equal to the matrix product #A\vec{y}\in\mathbb{R}^q#. The composite map #L_ A L_B:\mathbb{R}^p \rightarrow\mathbb{R}^q# therefore satisfies

\[\begin{array}{rcl}

(L_A L_B )\vec{x} &=& L_A ( L_B \vec{x} )\\&&\phantom{xx}\color{blue}{\text{definition of composition}}\\&=& L_A (B\vec{x})\\&&\phantom{xx}\color{blue}{\text{definition of }L_B}\\ &=&

A(B\vec{x}) \\&&\phantom{xx}\color{blue}{\text{definition of }L_A}\\ &=&(AB)\vec{x}\\ &&\phantom{xx}\color{blue}{\text{definition of the matrix product}}\\&=&L_{AB}(\vec{x})\\ &&\phantom{xx}\color{blue}{\text{definition of }L_{AB}}\end{array}

\]

We conclude that the linear map #L_AL_B# coincides with the linear map defined by the matrix #AB#.

The example #L_a# of multiplication by a number #a# on #\mathbb{R}^n# is a special case of this, for #L_a # is the linear map determined by the matrix #a\cdot I_n#.

Calculate the composition #F\, G# of the linear maps #F# and #G# from #\mathbb{R}^2# to #\mathbb{R}^2# given by

\[\begin{array}{rcl}F(\rv{x,y}) &=& \rv{2 {\it x}-2 {\it y},-4 {\it x}-5 {\it y}}\\

G(\rv{x,y}) &=& \rv{5 {\it y}, {\it x}}\end{array}\]

Give your answer in the form of a vector of length two, whose components are linear expressions in #x# and #y#.

Solution #F\,G(\rv{x,y}) = # #\rv{10 {\it y}-2 {\it x},-5 {\it x}-20 {\it y}}#

This follows from the following calculation.

\[\begin{array}{rcl}

F\, G(\rv{x,y}) &=&F(G(\rv{x,y}))\\

&&\phantom{xxx}\color{blue}{\text{definition of composition}}\\

&=&F(\rv{5 {\it y}, {\it x}})\\

&&\phantom{xxx}\color{blue}{\text{function rule for }G\text{ substituted}}\\

&=& \rv{2 { (5 { y})}-2 { ({ x})}, -4 { (5 { y})}-5 { ({ x})}}\\

&&\phantom{xxx}\color{blue}{\text{function rule for }F\text{ substituted}}\\

&=&\rv{10 {\it y}-2 {\it x}, -5 {\it x}-20 {\it y}}\\

&&\phantom{xxx}\color{blue}{\text{components simplified}}\\

\end{array}\]