An optimal path cannot contain a nonoptimal continuation from a state it reaches. A small computation will anchor the general statement before the abstraction takes over.
Notation
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.
I keep the defining relation \(\mathsf D\) above the derived relation \(\mathsf C\). This exposes whether cancellation used \(x\ne0\) and whether the conclusion is canonical.
Stress the formula
The middle display is intentionally dense: it is where signs, bounds, multiplicities, or normalising factors are most likely to be lost.
Interpretation
The two-row display is also a debugging tool: if the conclusion changes when only notation changes, some hidden choice has entered the argument.
Limit of the argument
State compression is an implementation change, not the definition. Loop order is safe only after the uncompressed dependency graph is understood.
The notation is dense, but it is doing honest work: every delimiter records scope and every index records dependence. Removing one should require a mathematical reason.