# Relative Matrix of Composition of Linear Transformations

## Theorem

Let $R$ be a ring with unity.

Let $M, N, P$ be free $R$-modules of finite dimension $m, n, p > 0$ respectively.

Let $\mathcal A,\mathcal B,\mathcal C$ be ordered bases of $M, N, P$.

Let $f: M \to N$ and $g : N \to P$ be linear transformations, and $g \circ f$ be their composition.

Let $\mathbf M_{f, \mathcal B, \mathcal A}$ and $\mathbf M_{g, \mathcal C, \mathcal B}$ be their matrices relative to $\mathcal A, \mathcal B$ and $\mathcal B, \mathcal C$ respectively.

Then the matrix of $g \circ f$ relative to $\mathcal A$ and $\mathcal C$ is:

$\mathbf M_{g \mathop \circ f, \mathcal C, \mathcal A} = \mathbf M_{g, \mathcal C, \mathcal B}\cdot \mathbf M_{f, \mathcal B, \mathcal A}$

## Proof 1

Let $m\in M$, and $[m]_{\mathcal A}$ be its coordinate vector with respect to $\mathcal A$.

On the one hand:

 $\displaystyle [g(f(m))]_{\mathcal C}$ $=$ $\displaystyle \mathbf M_{(g\mathop\circ f), \mathcal C, \mathcal A} \cdot [m]_{\mathcal A}$ Change of Coordinate Vectors Under Linear Mapping applied to $g\circ f$

On the other hand:

 $\displaystyle [g(f(m))]_{\mathcal C}$ $=$ $\displaystyle \mathbf M_{g, \mathcal C, \mathcal B} \cdot [f(m)]_{\mathcal B}$ Change of Coordinate Vectors Under Linear Mapping applied to $g$ $\displaystyle$ $=$ $\displaystyle \mathbf M_{g, \mathcal C, \mathcal B} \cdot \mathbf M_{f, \mathcal B, \mathcal A} \cdot [m]_{\mathcal A}$ Change of Coordinate Vectors Under Linear Mapping applied to $f$

Thus $(\mathbf M_{(g\mathop\circ f), \mathcal C, \mathcal A} - \mathbf M_{g, \mathcal C, \mathcal B} \cdot \mathbf M_{f, \mathcal B, \mathcal A}) \cdot [m]_{\mathcal A} = 0$ for all $m\in M$.

The result follows.

$\blacksquare$

## Proof 2

Let:

$\mathcal A = \left \langle {a_m} \right \rangle$
$\mathcal B = \left \langle {b_n} \right \rangle$
$\mathcal C = \left \langle {c_p} \right \rangle$

Let:

$\left[{\alpha}\right]_{m n} = \left[{f; \left \langle {b_n} \right \rangle, \left \langle {a_m} \right \rangle}\right]$

and:

$\left[{\beta}\right]_{n p} = \left[{g; \left \langle {c_p} \right \rangle, \left \langle {b_n} \right \rangle}\right]$

Then:

 $\displaystyle \left({g \circ f}\right) \left({a_j}\right)$ $=$ $\displaystyle v \left({f \left({a_j}\right)}\right)$ $\displaystyle$ $=$ $\displaystyle v \left({\sum_{k \mathop = 1}^n \alpha_{k j} b_k}\right)$ $\displaystyle$ $=$ $\displaystyle \sum_{k \mathop = 1}^n \alpha_{k j} v \left({b_k}\right)$ $\displaystyle$ $=$ $\displaystyle \sum_{k \mathop = 1}^n \alpha_{k j} \left({\sum_{i \mathop = 1}^p \beta_{i k} c_i}\right)$ $\displaystyle$ $=$ $\displaystyle \sum_{k \mathop = 1}^n \left({\sum_{i \mathop = 1}^p \alpha_{k j} \beta_{i k} c_i}\right)$ $\displaystyle$ $=$ $\displaystyle \sum_{i \mathop = 1}^p \left({\sum_{k \mathop = 1}^n \alpha_{k j} \beta_{i k} c_i}\right)$ $\displaystyle$ $=$ $\displaystyle \sum_{i \mathop = 1}^p \left({\sum_{k \mathop = 1}^n \alpha_{k j} \beta_{i k} }\right) c_i$

$\blacksquare$