Matrix chain multiplication recurrence and its solution
We get the recurrence by considering all possible ways of breaking up $A_i \times \cdots \times A_j$.
Specifically, we consider $(A_i \times \cdots \times A_k) \times (A_{k+1} \times \cdots \times A_j)$ for all relevant values of $k$, which are $i,\ldots,j-1$.