Changing addition and multiplication in a path algebra changes what a matrix product aggregates. The formulas are more useful when each symbol has a job rather than merely decorating the theorem.
Start locally
A full dynamic-programming state \(dp[i][s]\) states exactly which prefix \(i\) and mathematical state \(s\) have been processed. The recurrence is a theorem about transitions between these states.
There are two layers here: the object \(\mathsf D\) and the law \(\mathsf C\). Writing them separately makes the direction of \(\Longrightarrow\) visible and keeps an accidental converse from slipping in.
Compute before generalising
An explicit case prevents the notation from becoming ceremonial. Every subscript and superscript in the display contributes to the value.
The global view
The two-row display is also a debugging tool: if the conclusion changes when only notation changes, some hidden choice has entered the argument.
Edge conditions
State compression is an implementation change, not the definition. Loop order is safe only after the uncompressed dependency graph is understood.
The important habit is to remember what was fixed before the calculation began and what was proved only afterward. The final display preserves that order.