Number of non-decreasing functions on rectangles I was thinking about a question about counting tilings hexagonal zonotopes (i.e. hexagons where opposite edges are of equal length and parallel) by parallelograms, and reduced what I was working on to the following question:

How many ways are there to fill in a $a\times b$ rectangular grid with the numbers $\{0,1,\ldots,c\}$ such that the numbers are non-decreasing along each row and column?

Or, equivalently

How many increasing functions are there from the poset $\{1,\ldots, a\}\times \{1,\ldots, b\}$ to $\{0,1,\ldots,c\}$?

Let's let $N(a,b,c)$ be this quantity.
I did a bit of research, and found that this is the same as counting the number of semistandard Young tableaux in a rectangular shape with weight sequence of length $c+1$, and could therefore be written as a nasty sum of Kostka numbers, however this seems like overkill because I don't want the granularity of specifying a weight sequence nor the generality of working on any shape of tableaux.
If $c=1$, this simply reduces to ${a+b\choose a}$ because one can draw the boundary between the $1$'s and the $0$'s in the rectangle, and realize that this is a monotone path between corners - and that this correspondence is a bijection. I'm not exactly sure how it plays in the combinatorial world, but in my original problem the roles of $a$, $b$, and $c$ were interchangeable, so I assume they should still be here. It's also clear enough that if you fix $b$ and $c$, you can consider the possible transitions between the ${b+c \choose c}$ possible non-decreasing columns and derive a formula for varying $a$ with linear algebra. There's also relations such as $N(a,b,c_1+c_2) \leq N(a,b,c_1)N(a,b,c_2)$ since each increasing function with codomain $\{0,\ldots, c_1+c_2\}$ can be written (not in a unique way) as a sum of a functions with codomains $\{0,\ldots,c_1\}$ and $\{0,\ldots,c_2\}$.
I should expect this is a hard question in general - so I mostly want to ask a more narrow variant:

Is there a closed form for $N(a,b,2)$?

 A: Using a brute force method and OEIS (For example: here is the case $b=5,$ check the Cross references) I get that $$N(a,b,2)=\binom{a+b+1}{a}^2-\binom{a+b+2}{a+1}\binom{a+b}{a-1}.$$ This suggest the relation
$$N(a,b,2)=N(a-1,b,2)+N(a,b-1,2)+2\binom{a+b}{a}\binom{a+b}{a-1}-\binom{a+b+1}{a+1}\binom{a+b-1}{a-2}-\binom{a+b-1}{a-1}\binom{a+b+1}{a}$$
$$N(a,b,2)=N(a-1,b,2)+N(a,b-1,2)+2N(a,b,1)N(a-1,b,1)-N(a+1,b,1)N(a-2,b+1,1)-N(a-1,b,1)N(a,b+1,1),$$
which probably helps to now how the recursion might be.
Notice that $$N(a,b,2)=\det\left (\begin{matrix}\binom{a+b+1}{a}&\binom{a+b+2}{a+1}\\
\binom{a+b}{a-1} & \binom{a+b+1}{a}\end{matrix}\right )$$
which suggests that there should be a Viennot-Gessel determinant idea - extending the idea that $N(a,b,1)$ counts the number of paths across a rectangle; by drawing the boundaries between where an increasing function $\{1,\ldots, a\}\times \{1,\ldots, b\}\rightarrow \{0,1,2\}$ changes from $0$ to $1$ or $1$ to $2$, we get two paths across that may overlap but never strictly cross; by appropriately shifting one path by $1$ unit in both direction, we can put paths that don't strictly cross in bijection with monotone non-intersecting paths, with one path going $(0, 1)$ to $(a, b+1)$ and another $(1, 0)$ to $(a+1,b)$. The number of such pairs of paths is, by the Viennot-Gessel determinant (noting that all pairs of non-intersecting paths with these endpoints math the $(0,1)$ point to the $(a,b+1)$ and the $(1,0)$ to the $(a+1,b)$):
$$\det\begin{pmatrix}{a+b\choose a} & {a+b\choose a-1} \\ {a+b\choose a+1} & {a+b \choose a} \end{pmatrix}.$$
This turns out equal to the previous expression. More generally,
$$N(a,b,c)=\det\begin{pmatrix}{a+b\choose a} & {a+b\choose a-1} & {a+b \choose a-2} & \cdots & 
{a+b \choose a - c + 1} \\
{a+b\choose a+1} & {a+b\choose a} & {a+b\choose a-1} & \cdots & {a+b\choose a-c+2}\\
{a+b \choose a+ 2} & {a+b \choose a+1} & {a+b \choose a} & \cdots & {a+b\choose a-c+3} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
{a+b \choose a + c - 1} & {a+b \choose a+c - 2} & {a+b \choose a+c - 3} & \ldots &{a+b \choose a}
\end{pmatrix}$$
by this argument, where the lower term in the binomial is constant along the main diagonal and all diagonals parallel to it, increasing by one for each entry when one moves down or left in the matrix.
