---
tag: 073E4XC016
kind: statement
role: proposition
name: Associativity of matrix multiplication
msc: [15A99]
uses: [076JGP6R3T]
sources:
  - url: https://en.wikipedia.org/wiki/Matrix_multiplication
    locator: General properties
---

## Statement

Let $R$ be a ring and let $m, n, p, q \ge 0$ be integers.
Let $A$ be an $m \times n$ matrix, $B$ an $n \times p$ matrix and $C$ a $p \times q$ matrix over $R$.
Then $(AB)C = A(BC)$, where the products are [[matrix products|032Q9FB8MT]].

## Remarks

Both sides have entry $(i, l)$ equal to $\sum_{j=1}^{n} \sum_{k=1}^{p} a_{ij} b_{jk} c_{kl}$.
Because of this property, the product $ABC$ needs no parentheses.
The property also follows from the associativity of the composition of linear maps.

## Explanations

### L1 human

When we multiply three matrices, we may multiply the first two first, or the last two first.
The result is the same in both cases.
This is like $(2 \cdot 3) \cdot 4 = 2 \cdot (3 \cdot 4)$ for numbers.
