What summation rule am I missing here?

51 Views Asked by At

I was trying to prove the associativity of matrix dot products and I think I almost got it till the last step where I'm stuck, probably due to my lack of knowledge about summation rules.

I have $A\in\mathbb R^{m\times n}, B\in\mathbb R^{n\times p}, C\in\mathbb R^{p\times q}$. And, I need to prove that $(AB)C = A(BC).$

I've also taken general terms of $A,B$ and $C$ to be $a_{ih}$, $b_{hj}$ and $c_{jk}$ where
$i = 1,2,....m$
$h = 1,2,....n$
$j = 1,2,....p$
$k = 1,2,....q$

With all this I've found that:

  1. General term of $(AB)C = \sum_{r=1}^{p}[\sum_{l=1}^{n}a_{il}b_{lr}c_{rk}]$

  2. General term of $A(BC) = \sum_{l=1}^{n}[\sum_{r=1}^{p}a_{il}b_{lr}c_{rk}]$

Now, I know that the above two equations should be equal, but I'm not sure if there's a rule/property of summations that lets me exchange the places of the 2 summations so that I can equate the general terms.

So, bearing with me if I'm being too much of a noob, could somebody tell me if such a rule exists or if not what I can do instead?

Note: Feel free to correct me if you think my whole proof is a mistake.