Product of Finite Sequence of Matrices

Theorem
Let $\mathbf A_1, \mathbf A_2, \ldots, \mathbf A_n$ be matrices.

Let the dimensions of $\mathbf A_j$ be $d_j \times d_{j+1}$.

Let $\displaystyle \mathbf C := \prod_{j \mathop = 1}^n \mathbf A_j = \mathbf A_1 \mathbf A_2 \cdots \mathbf A_n$ be the (conventional) matrix product of $\mathbf A_1, \mathbf A_2, \ldots, \mathbf A_n$.

Then:
 * $(1): \quad \displaystyle c \left({i_1, i_{n+1}}\right) = \sum_{i_n \mathop = 1}^{d_n} \cdots \sum_{i_3 \mathop = 1}^{d_3} \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right) \cdots a_{n-1} \left({i_{n-1}, i_n}\right) a_n \left({i_n, i_{n+1}}\right)$

where:
 * $a_1 \left({i_1, i_2}\right)$ (for example) denotes the element of $\mathbf A_1$ whose indices are $i_1$ and $i_2$
 * the dimensions of $\mathbf C$ are $d_1 \times d_{n+1}$.

Proof
Proof by induction:

For all $n \in \N_{> 0}$, let $P \left({n}\right)$ be the proposition:
 * $\displaystyle c \left({i_1, i_{n+1}}\right) = \sum_{i_n \mathop = 1}^{d_n} \cdots \sum_{i_3 \mathop = 1}^{d_3} \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right) \cdots a_{n-1} \left({i_{n-1}, i_n}\right) a_n \left({i_n, i_{n+1}}\right)$

$P \left({1}\right)$ is trivially true, as this just says:
 * $c \left({i_1, i_2}\right) = a_1 \left({i_1, i_2}\right)$

Basis for the Induction
$P \left({2}\right)$ is the case:
 * $\displaystyle c \left({i_1, i_3}\right) = \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right)$

which is the definition of (conventional) matrix product.

The dimensions of $\mathbf C$ are $d_1 \times d_3$, while those of $\mathbf A_1$ and $\mathbf A_2$ are $d_1 \times d_2$ and $d_2 \times d_3$ respectively.

This is our basis for the induction.

Induction Hypothesis
Now we need to show that, if $P \left({k}\right)$ is true, where $k \ge 2$, then it logically follows that $P \left({k+1}\right)$ is true.

So this is our induction hypothesis:
 * $\displaystyle c \left({i_1, i_{k+1}}\right) = \sum_{i_k \mathop = 1}^{d_k} \cdots \sum_{i_3 \mathop = 1}^{d_3} \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right) \cdots a_k \left({i_k, i_{k+1}}\right)$

Then we need to show:
 * $\displaystyle c \left({i_1, i_{k+2}}\right) = \sum_{i_{k+1} \mathop = 1}^{d_{k+1}} \sum_{i_k \mathop = 1}^{d_k} \cdots \sum_{i_3 \mathop = 1}^{d_3} \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right) \cdots a_k \left({i_k, i_{k+1}}\right) a_k \left({i_{k+1}, i_{k+2}}\right)$

Induction Step
This is our induction step:

Let $\displaystyle \mathbf C_1 := \prod_{j \mathop = 1}^k \mathbf A_j$.

Let $\displaystyle \mathbf C := \prod_{j \mathop = 1}^{k+1} \mathbf A_j = \mathbf C_1 \mathbf A_{k+1}$.

So $P \left({k}\right) \implies P \left({k+1}\right)$ and the result follows by the Principle of Mathematical Induction.

Therefore for all $n \in \N_{>0}$:
 * $\displaystyle c \left({i_1, i_{n+1}}\right) = \sum_{i_n \mathop = 1}^{d_n} \cdots \sum_{i_3 \mathop = 1}^{d_3} \sum_{i_2 \mathop = 1}^{d_2} a_1 \left({i_1, i_2}\right) a_2 \left({i_2, i_3}\right) \cdots a_{n-1} \left({i_{n-1}, i_n}\right) a_n \left({i_n, i_{n+1}}\right)$