Nested sums inequality chain On this post, there appears the following expression:
\begin{align}
\sum_{m_1=0}^{9}\sum_{m_2=0}^{m_1-1}\sum_{m_{3}=0}^{m_{2}-1}\sum_{m_{4}=0}^{m_{3}-1}\sum_{m_{5}=0}^{m_{4}-1}1  =\sum_{0\leq m_{1}<m_{2}<m_3<m_4<m_5\leq 9}1
\end{align}
which is explained as "writing the range of summation as inequality chain."
I don't see why $m_5,$ for example, has to be larger than $m_4,$ or any of the other inequalities. Or why $9$ is the maximum value.
Can someone please explain with an example how this notation works?
Thank you for the comments, I see it is now corrected, but I still don't know if this works like this - with increasing limits of summation from innermost to outermost simply because we are adding $1$'s in this case, because when we do double integrals, the limits of integration over each variable don't necessarily follow a sequence. What is different in the case of summations?
 A: It might help to view it from a programming perspective . . .

Suppose we wanted to compute
$$
\sum_{m_1=0}^{9}\sum_{m_2=0}^{m_1-1}\sum_{m_{3}=0}^{m_{2}-1}\sum_{m_{4}=0}^{m_{3}-1}\sum_{m_{5}=0}^{m_{4}-1}1
$$
in a program.

Consider the following Maple program . . .
    x:=0:
    for m1 from 0 to 9 do
      for m2 from 0 to m1-1 do
        for m3 from 0 to m2-1 do
          for m4 from 0 to m3-1 do
            for m5 from 0 to m4-1 do
              x:=x+1
            od
          od
        od
      od
    od:
    x;
Let $M$ be the set of $5$-tuples $m=(m_5,m_4,m_3,m_2,m_1)$ of integers such that
$$0 \le m_5 < m_4 < m_3 < m_2 < m_1\le 9$$
Note that whenever the statement $x\,{:}{=}\,x+1$ is executed, we have $(m_5,m_4,m_3,m_2,m_1)\in M$.

Moreover, for every  $5$-tuple $m\in M$ the statement $x\,{:}{=}\,x+1$ is executed exactly once.

Hence the final value of $x$ is just the cardinality of $M$, which is the same as
$\\[10pt]$
$$\sum_{m\in M} 1$$
or equivalently
$$\sum_{0 \le m_5 < m_4 < m_3 < m_2 < m_1\le 9} 1$$
