1 Introduction

For a partition \(\lambda \) and a natural number t, the t-core of \(\lambda \), written \({{\,\textrm{core}\,}}_t \lambda \), is obtained by removing hooks of size t from the Young diagram of \(\lambda \), until no more can be removed. This analogue of the Division Algorithm has its origins in the representation theory of the symmetric group [9], and finds application in the study of the partition function [12]. We present an analogue of the Chinese Remainder Theorem in this paper.

Write \(\mathcal {C}_t\) for the set of t-cores. Suppose \(s, t \in \mathbb {N}\) are relatively prime, and consider the map

$$\begin{aligned} {{\,\textrm{core}\,}}_{s, t}: \mathcal {C}_{st} \rightarrow \mathcal {C}_s \times \mathcal {C}_t \end{aligned}$$

taking \(\lambda \) to \(({{\,\textrm{core}\,}}_s \lambda ,{{\,\textrm{core}\,}}_t \lambda )\). This map \({{\,\textrm{core}\,}}_{s,t}\) is surjective ([6], Sect. 5.1), but far from injective. In fact the fibres are infinite. To capture their behaviour we stratify them by length as follows.

Given a partition \(\lambda \), write \(\ell (\lambda )\) for its length, meaning the number of parts of \(\lambda \). For a fixed \((\sigma , \tau ) \in \mathcal {C}_s \times \mathcal {C}_t\), let \(m = st\) and put

$$\begin{aligned} N_{\sigma , \tau }(k)= \#\{ \lambda \in \mathcal {C}_{m} \mid {{\,\textrm{core}\,}}_s \lambda =\sigma , \, {{\,\textrm{core}\,}}_t \lambda = \tau , \, \ell (\lambda ) \le k \}. \end{aligned}$$
(1)

In other words, \(N_{\sigma , \tau }(k)\) is the cardinality of the kth stratum,

$$\begin{aligned} {{\,\textrm{core}\,}}_{s,t}^{-1}(\sigma , \tau ) \cap \mathcal {C}_m^k \end{aligned}$$
(2)

where \(\mathcal {C}_m^k\) is the set of m-cores of length no greater than k.

Our first result is:

Theorem 1

Let \(s, t \in \mathbb {N}\) be relatively prime. There is a quasipolynomial \(Q_{\sigma ,\tau }(k)\) of degree \((s-1)(t-1)\) and period st, so that for integers \(k \gg 0\), we have \(N_{\sigma , \tau }(k)=~Q_{\sigma ,\tau }(k)\). The leading coefficient of \(Q_{\sigma ,\tau }(k)\) is a positive number \(V_{s,t}\) depending only on s and t.

Here, a “quasipolynomial of period n” is a function on natural numbers whose restriction to each coset \(n \mathbb {N}+i\) is a polynomial; see Sect.  4. The quantity \(V_{s,t}\) is the volume of a certain polytope we define in Sect.  8.

Remark 1

If \(\sigma = \tau \), then \(\sigma \) is simultaneously an s-core and a t-core. In fact, the intersection \(\mathcal {C}_s \cap \mathcal {C}_t\) is finite and well studied; see [1] and [7]. In [3] and [10], the authors study simultaneous core partitions when s and t have a common factor.

Our method is as follows. We associate to \(\tau \in \mathcal {C}_t^k\) a multiset \(H_{\tau ,t}^k\) on \(\{0,1,\ldots , t-1\}\) of size k, corresponding to the first column hook lengths of \(\tau \) modulo t. (This is James’ theory of abacuses [7, p. 78].) Members of (2) correspond to matchings between \(H_{\sigma ,s}^k\) and \(H_{\tau ,t}^k\). (See Sect. 5.3.)

Generally, let FG be multisets of the same size, with multiplicity vectors \(\vec {F}\), \(\vec {G}\). Write \(\mathcal {M}(\vec {F},\vec {G})\) for the polytope of real matrices with nonnegative entries, row margins \(\vec {F}\), and column margins \(\vec {G}\). Then the matchings between F and G correspond bijectively with the integer points of \(\mathcal {M}(\vec {F},\vec {G})\).

In our situation, the polytopes \(\mathcal {M}\) grow linearly in k, and we may apply Ehrhart’s theory, which says that if \(\mathcal {P}\) is a polytope with integer vertices, then the number of integer points in \(n \cdot \mathcal {P}\) is a polynomial in  n. We refer the reader to Sect. 4.6.2 of [11], and Chapter 3 of [2]. The degree of the polynomial is the dimension of \(\mathcal {P}\), and its leading coefficient is the relative volume of \(\mathcal {P}\). In [12], the simultaneous (s; t)-cores for s; t relatively prime are identified with the lattice points in a rational simplex, and using Ehrhart theory the author reproves Anderson’s theorem [1] and using Euler-Maclaurin theory proves Armstrong’s conjecture [2].

When \(\sigma =\tau =\emptyset \), and k is a multiple of st, this directly gives our result. The technical heart of this paper is extending Ehrhart’s Theorem to all fibres and all k.

The polytopes \(\mathcal {M}(\vec {F},\vec {G})\) arising from row/column constraints are called “transportation polytopes”. Each can be expressed in the form

$$\begin{aligned} \mathcal {P}(A,\vec {b})=\{ \vec {x} \mid A \vec {x} \le \vec {b}, \vec {x} \ge 0 \}, \end{aligned}$$

for some totally unimodular matrix A, meaning that all the minors of  A are either 0, 1 or \(-1\). Write \(N(A, \vec {b})\) for the number of integer points in the polytope \(\mathcal {P}(A, \vec {b})\). Our extension of Ehrhart’s Theorem is

Theorem 2

Let A be an \(m \times n\) totally unimodular matrix and \(\vec {b}, \vec {c} \in \mathbb {Z}^m\). Suppose A does not have any zero rows, and that \(\mathcal {P}(A, \vec {b})\) is bounded of dimension n. Then there is a polynomial f(k) so that for integers \(k \gg 0\), we have \(N(A, \vec {b}k+\vec {c})=f(k)\). Moreover, \(\deg f=n\) and the leading coefficient of f is the volume of \(\mathcal {P}(A,\vec {b})\).

Note that Ehrhart’s Theorem gives the case \(\vec {c} = 0\).

Next, suppose s and t are not relatively prime. Let \(d=\gcd (s,t)\), \(m=~{{\,\textrm{lcm}\,}}(s,t)\) and \(\ell _0 = \max (\ell (\sigma ), \ell (\tau ))\). Again define \(N_{\sigma , \tau }(k)\) by (1).

Theorem 3

If \({{\,\textrm{core}\,}}_d(\sigma ) = {{\,\textrm{core}\,}}_d(\tau )\), then there is a quasipolynomial \(Q_{\sigma , \tau }(k)\) of degree \(\frac{1}{d} (s-d)(t-d)\) and period m, so that for integers \(k \gg 0\), we have \(N_{\sigma , \tau }(k)=~Q_{\sigma ,\tau }(k)\). The leading coefficient of \(Q_{\sigma , \tau }(k)\) is \(\left( V_{\frac{s}{d},\frac{t}{d}}\right) ^d.\)

(It is easy to see that if \({{\,\textrm{core}\,}}_d(\sigma ) \ne {{\,\textrm{core}\,}}_d(\tau )\), then each \(N_{\sigma , \tau }(k)=0\).)

We mention also a simpler related result for the fibres of the map \({{\,\textrm{core}\,}}_s:~\mathcal {C}_{st} \rightarrow \mathcal {C}_s\) taking an st-core to its s-core. For \(\sigma \in \mathcal {C}_s\), let

$$\begin{aligned} N_{\sigma }(k)=\{\lambda \in \mathcal {C}_{st} \mid {{\,\textrm{core}\,}}_s \lambda = \sigma , \ell (\lambda ) \le k\}. \end{aligned}$$

Theorem 4

There is a quasipolynomial \(Q_{\sigma }(k)\) of degree \(s(t-1)\) and period s, so that for \(k \ge \ell (\sigma )\), we have \(N_{\sigma }(k)=Q_{\sigma }(k)\). The leading coefficient of \(Q_\sigma (k)\) is \(\dfrac{1}{(t-1)!^s}\).

The layout of this paper is as follows. In Sect. 2, we recall terminology for partitions and multisets, and in Sect. 3, we review James’ Theory of abacuses for computing t-cores. Theorem 4 is worked out in Sect. 4, as a warmup to later material. Section 5 converts the fibre counting problem into a multiset matching problem. Preliminaries for polytopes are given in Sect. 6. Our theory of integer points in polytopes, including Theorem 2, is contained in Section 7. Finally in Sect. 8, we apply this to our core problem, giving Theorems 1 and 3.

2 Preliminaries

Write \(\mathbb {N}=\{1,2,\ldots \}\) for the set of natural numbers and \(\underline{\mathbb {N}}=\{0,1,2, \ldots \}\) for the set of whole numbers. If S is a set, write ‘\({{\,\textrm{id}\,}}_S\)’ for the identity map. If \(f: S \rightarrow T\) is a map, write ‘\({{\,\textrm{im}\,}}f\)’ for the image of f. We write \(\mathscr {P}_{{{\,\textrm{fin}\,}}}(S)\) for the set of finite subsets of S.

2.1 Multisets

Let S be a set. When S is a finite set, we write either ‘\(\#S\)’ or ‘\(\mid S \mid \)’ for the cardinality of S. For \(k \in \underline{\mathbb {N}}\), write \(\left( {\begin{array}{c}S\\ k\end{array}}\right) \) for the set of k-element subsets of S. Note that \(\# \left( {\begin{array}{c}S\\ k\end{array}}\right) =\left( {\begin{array}{c}\# S\\ k\end{array}}\right) \).

A multiset on S is a function F from S to \(\underline{\mathbb {N}}\). The cardinality of F is the sum

$$\begin{aligned} \mid F \mid =\sum _{s \in S} F(s). \end{aligned}$$

The support of a multiset F is

$$\begin{aligned} {{\,\textrm{supp}\,}}(F)=\{s \in S \mid F(s) \ne 0 \}. \end{aligned}$$

Write ‘\(\big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\)’ for the set of multisets on S of cardinality k. Note that \(\# \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )= \big (\!\genfrac(){0.0pt}1{\# S}{k}\!\big )\), where

$$\begin{aligned} \bigg (\!\!\genfrac(){0.0pt}0{n}{k}\!\!\bigg )= \left( {\begin{array}{c}k+n-1\\ k\end{array}}\right) . \end{aligned}$$

Write \(\mathcal {M}_{{{\,\textrm{fin}\,}}}(S)\) for the set of multisets on S with finite support. Thus,

$$\begin{aligned} \mathcal {M}_{{{\,\textrm{fin}\,}}}(S)= \bigcup _{k \ge 0} \bigg (\!\!\genfrac(){0.0pt}0{S}{k}\!\!\bigg ). \end{aligned}$$

Given finite sets ST and a map \(f: S \rightarrow T\), define \(f_*: \mathcal {M}_{{{\,\textrm{fin}\,}}}(S) \rightarrow \mathcal {M}_{{{\,\textrm{fin}\,}}}(T)\) by

$$\begin{aligned} f_*(F)(t) = \sum \limits _{s \in f^{-1}(t)}F(s). \end{aligned}$$

We use the same notation to denote the restriction \(f_*: \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\), when k is understood.

Lemma 1

For \(G \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(T)\), we have

$$\begin{aligned} \# (f_*)^{-1}(G)=\prod _{t \in T} \big (\!\genfrac(){0.0pt}1{\#f^{-1}(t)}{G(t)}\!\big ). \end{aligned}$$

Proof

We need to count the \(F \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(S)\) such that for all \(t \in T\), we have

$$\begin{aligned} \begin{aligned} G(t)&= f_*(F)(t) \\&= \sum _{s \in f^{-1}(t)} F(s). \\ \end{aligned} \end{aligned}$$

There are \( \big (\!\genfrac(){0.0pt}1{\#f^{-1}(t)}{G(t)}\!\big )\) many choices for the values of F on the fibre over \(t \in T\). Multiplying these gives the formula. \(\square \)

Note that

$$\begin{aligned} {{\,\textrm{im}\,}}f_*= \{H \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(T) \mid {{\,\textrm{supp}\,}}(H) \subseteq {{\,\textrm{im}\,}}(f)\}. \end{aligned}$$

For maps \(f: S \rightarrow T\) and \(g: T \rightarrow U\), note that \(\left( g \circ f\right) _* = g_* \circ f_*,\) and \(\left( {{\,\textrm{id}\,}}_S\right) _* = {{\,\textrm{id}\,}}_{\big (\!\genfrac(){0.0pt}1{S}{k}\!\big )}\). This makes the association \(S \leadsto \mathcal {M}_{{{\,\textrm{fin}\,}}}(S)\) a functor from the category of sets to itself.

2.2 Partitions and pseudopartitions

A partition \(\lambda \) is a weakly decreasing finite sequence of natural numbers. Thus, \(\lambda = \left( a_1, a_2, \ldots , a_\ell \right) \), with \(a_1 \ge a_2 \ge \cdots \ge a_\ell >0\). In these terms, \(a_1+a_2+ \cdots +a_\ell \) is the size of \(\lambda \), and \(\ell =\ell (\lambda )\) is the length of  \(\lambda \). We allow the empty partition \(\lambda =\emptyset \); its length is 0. Write \(\Lambda \) for the set of partitions, and \(\Lambda ^\ell \) for the set of partitions of length \(\ell \).

We define pseudopartitions to be weakly decreasing finite sequences of whole numbers. Thus, \(\lambda = \left( a_1, a_2, \ldots , a_\ell \right) \), with \(a_1 \ge a_2 \ge \cdots \ge a_\ell \ge 0\). Again, \(\ell \) is the length of \(\lambda \). For instance \(\lambda =(5,4,3,1,0,0)\) is a pseudopartition of length 6, with 2 “trailing zeros”. Write \(\underline{\Lambda }\) for the set of pseudopartitions, and \(\underline{\Lambda }^k\) for the set of pseudopartitions of length k. Let \(z: \underline{\Lambda }\rightarrow \underline{\Lambda }\) be the map which adds a trailing zero to the end of a pseudopartition. For instance \(z((5,4,0))=(5,4,0,0)\). If \(\lambda \) is a pseudopartition of length \(\ell \le k\), define

$$\begin{aligned} u^k(\lambda )=z^{k-\ell }(\lambda ) \in \underline{\Lambda }^k. \end{aligned}$$

Write \(r: \underline{\Lambda }\rightarrow \Lambda \) for the map which removes all trailing zeros from the pseudopartition to make it a partition, e.g. \(r((5,4,3,1,0,0))=(5,4,3,1)\). The fibres of r are the z-orbits of partitions.

2.3 Young diagrams

The Young diagram of a partition \(\lambda = \left( a_1, a_2, \ldots , a_\ell \right) \) is given by

$$\begin{aligned} \mathcal {Y}(\lambda ) = \{ (i,j) \in \mathbb {N} \times \mathbb {N} \mid 1 \le i \le \ell , 1 \le j \le a_i \}. \end{aligned}$$

It is visualized as a collection of left justified cells arranged in rows with \(a_i\) cells in the i-th row.

Example 1

Here is \(\mathcal {Y}((5,4,3,1))\):

figure a

The hook \(\mathfrak {h}_c\) associated to a cell c of \(\mathcal {Y}(\lambda )\) consists of all cells to the right of c and below c, together with c itself. The hooklength is the total number of cells in the hook. In the above diagram, the hooklength for the (1, 1)-cell is 8. A hook with hooklength t is called a t-hook.

Remark 2

It would be more consistent to say “hooksize” rather than “hooklength”, but the usage is standard.

Of particular importance are the hooklengths corresponding to cells in the first column of \(\mathcal {Y}(\lambda )\); we can use these to reconstruct \(\lambda \). The set of first column hooklengths in Example 1 is \(\{ 8,6,4,1 \}\).

2.4 Beta sets

The map which takes a partition \(\lambda \) to the set of first column hooklengths of \(\mathcal {Y}(\lambda )\) gives a bijection between \(\Lambda \) and \(\mathscr {P}_{{{\,\textrm{fin}\,}}}(\mathbb {N})\). In this paragraph, we extend this to a bijection between \(\underline{\Lambda }\) and \(\mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\).

Define \(\beta : \underline{\Lambda }\rightarrow \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\) by

$$\begin{aligned} \beta ((a_1, a_2, \ldots , a_\ell ))= \{a_1 + (\ell -1), a_2 + (\ell -2), \ldots , a_\ell \}. \end{aligned}$$

The inverse \(\beta ^{-1}:\mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}) \rightarrow \underline{\Lambda }\) is given by

$$\begin{aligned} \beta ^{-1}(\{ h_1, \ldots , h_\ell \})= (h_1-(\ell -1), h_2-(\ell -2), \ldots , h_\ell ), \end{aligned}$$

for \(h_1>\cdots >h_\ell \ge 0\). When \(\lambda \) is a partition, \(\beta (\lambda )\) is the set of first column hooklengths of \(\mathcal {Y}(\lambda )\). We also write ‘\(H_\lambda \)’ for \(\beta (\lambda )\).

The “add a trailing zero” map z translates under \(\beta \) to

$$\begin{aligned} Z=\beta \circ z \circ \beta ^{-1}: \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}) \rightarrow \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}), \end{aligned}$$

which comes out to be

$$\begin{aligned} \{x_1, \ldots , x_\ell \} \mapsto \{x_1+1, \ldots , x_\ell +1, 0\}. \end{aligned}$$

Similarly, we can translate \(u^k\) to

$$\begin{aligned} U^k=\beta \circ u^k \circ \beta ^{-1}. \end{aligned}$$

Definition 1

Let \(\lambda \) be a partition. A beta set of \(\lambda \) is a set of the form \(Z^j(\beta (\lambda ))\) for some \(j \in \underline{\mathbb {N}}\).

Example 2

Let \(\lambda = (5,4,3,1)\). Then \(H_{\lambda } = \{8,6,4,1\}\), so the beta sets of \(\lambda \) are:

$$\begin{aligned} \{8,6,4,1\} \overset{Z}{\mapsto }\{9,7,5,2,0\} \overset{Z}{\mapsto } \{10,8,6,3,1,0\} \overset{Z}{\mapsto }\ \ldots \end{aligned}$$

Definition 2

If \(\lambda \) is a partition of length \(\ell \le k\), write \(H_\lambda ^k\) for the beta set of \(\lambda \) with cardinality k, i.e.

$$\begin{aligned} H_\lambda ^k=U^k(H_\lambda )=Z^{k-\ell }(H_\lambda ). \end{aligned}$$

In the example above, \(H_\lambda ^6=\{10,8,6,3,1,0\}\).

The \(\beta \)-set version of the “remove all trailing zeros” retraction r is

$$\begin{aligned} R= \beta \circ r \circ \beta ^{-1}: \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}) \rightarrow \mathscr {P}_{{{\,\textrm{fin}\,}}}(\mathbb {N}). \end{aligned}$$

It can be computed directly as follows. Given \(X \in \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\) with \(0 \in X\), put

$$\begin{aligned} m=\min (\underline{\mathbb {N}}-X), \end{aligned}$$

i.e. the smallest whole number not in X. Then R(X) is obtained by removing \(\{0, \ldots , m-1\}\) from X and subtracting m from the remaining members. Of course, if \(0 \notin X\), then \(R(X)=X\).

3 Cores

Definition 3

A t-core is a partition having no t-hook in its Young diagram. Write \(\mathcal {C}_t\) for the set of t-cores, and put

$$\begin{aligned} \mathcal {C}_t^k=\{ \lambda \in \mathcal {C}_t \mid \ell (\lambda ) \le k \}. \end{aligned}$$

3.1 Hook removal

Suppose \(\lambda \) is a partition whose Young diagram contains a t-hook \(\mathfrak {h}\). One may remove \(\mathfrak {h}\) from \(\mathcal {Y}(\lambda )\) by simply deleting \(\mathfrak {h}\), then moving any disconnected cells one unit up and one unit to the left.

Example 3

The removal of a 6-hook from the partition (5, 4, 3, 1):

figure b

In fact, if we remove t-hooks successively until no t-hook remains, the final Young diagram does not depend on the choices of hooks at each step. The corresponding partition is called the t-core of \(\lambda \), and denoted ‘\({{\,\textrm{core}\,}}_t \lambda \)’.

Example 4

We remove 6-hooks successively from the Young diagram of (5, 4, 3, 1) to obtain its 6-core, which is the partition (1). In Example 3 we removed a 6-hook from (5, 4, 3, 1) to get (5, 2), continuing from there we remove the remaining 6-hook:

figure c

Lemma 2

Let \(\lambda \) be a partition, and \(X=\{x_1, \ldots , x_k \}\) a \(\beta \)-set for \(\lambda \). Then \(\mathcal {Y}(\lambda )\) has a t-hook iff \(\exists \;1 \le i \le k\) so that \(x_i \ge t\) and \(x_i-t \notin X\). In this case, there is a t-hook \(\mathfrak {h}\) of \(\mathcal {Y}(\lambda )\) so that

$$\begin{aligned} \{ x_1, \ldots , x_i-t, \ldots , x_k \} \end{aligned}$$
(3)

is a \(\beta \)-set for \(\lambda \backslash \mathfrak {h}\).

Proof

This is [7, Lemma 2.7.13]. \(\square \)

Example 5

The sequence of hook removals in Example 4 corresponds to the sequence

$$\begin{aligned} \{8,6,4,1\} \leadsto R(\{8,0,4,1\})=\{6,2\} \leadsto R(\{0,2\})=\{1\} \end{aligned}$$

of \(\beta \)-sets.

3.2 \(\beta \)-set version

Fix \(t \ge 1\).

Definition 4

A subset X of \(\underline{\mathbb {N}}\) is t-reduced, provided whenever \(x \in X\) with \(x \ge t\), we have \(x-t \in X\). Write \(\mathcal {R}_t\) for the set of finite t-reduced subsets of \(\mathbb {N}\), and \(\underline{\mathcal {R}}_t\) for the set of finite t-reduced subsets of \(\underline{\mathbb {N}}\).

For example, \(X=\{0,1,3,4,6\}\) is 3-reduced but not 2-reduced. We view \(\mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\), and thus, \(\underline{\mathcal {R}}_t\), inside \(\mathcal {M}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\) via recognizing a subset of  \(\underline{\mathbb {N}}\) as a multiset on \(\underline{\mathbb {N}}\). Note that the retraction R maps \(\underline{\mathcal {R}}_t\) to \(\mathcal {R}_t\).

Let

$$\begin{aligned} f_t: \underline{\mathbb {N}}\rightarrow \mathbb {Z}/t\mathbb {Z} \end{aligned}$$

be the usual remainder mod t map, and let

$$\begin{aligned} \rho _t=(f_t)_*: \mathcal {M}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}) \rightarrow \mathcal {M}_{{{\,\textrm{fin}\,}}}( \mathbb {Z}/t\mathbb {Z}) \end{aligned}$$

be the induced map on multisets.

The subset \(\underline{\mathcal {R}}_t\) is a transversal for \(\rho _t\), in the sense that for each \(F \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\), there is a unique \(F_0 \in \underline{\mathcal {R}}_t\) with \(\rho _t(F)=\rho _t(F_0)\).

Remark 3

For \(X \in \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\), the map \(X \mapsto X_0\) is traditionally visualized in terms of a base t abacus, having t runners labelled 0 to \(t-1\), on which beads may be stacked. Given X, beads are arranged on the abacus corresponding to their base t place value of members of X. To bring X to t-reduced form, one simply slides the beads up. This is James’ abacus method from [7, p. 78].

For example, given \(X = \{8,6,4,1\}\) and \(t=6\), the abacus method

figure d

gives \(X_0 = \{4,2,1,0\}.\)

The map \(\rho _t\) has a “minimal” section

$$\begin{aligned} c_t: \mathcal {M}_{{{\,\textrm{fin}\,}}}(\mathbb {Z}/t\mathbb {Z}) \rightarrow \mathcal {M}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}}) \end{aligned}$$

with image equal to \(\underline{\mathcal {R}}_t\), described as follows. Given \(F \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(\mathbb {Z}/t\mathbb {Z})\), put

$$\begin{aligned} c_t(F)=\bigcup _{i=0}^{t-1} \{ at+i \mid 0 \le a \le F(i) \}. \end{aligned}$$

Thus, the map \(F \mapsto F_0\) above is \(c_t \circ \rho _t\).

Definition 5

Given \(X \in \mathscr {P}_{{{\,\textrm{fin}\,}}}(\underline{\mathbb {N}})\), put

$$\begin{aligned} {{\,\textrm{Core}\,}}_t(X)=R(c_t(\rho _t(X))). \end{aligned}$$

Proposition 1

If \(\lambda \) is a pseudopartition, then

$$\begin{aligned} {{\,\textrm{core}\,}}_t(r(\lambda )) =\beta ^{-1}( {{\,\textrm{Core}\,}}_t(\beta (\lambda ))). \end{aligned}$$

Proof

Let \(X=\beta (\lambda )\), and suppose \(X_0\) is obtained from X by a sequence of steps, where each step replaces some \(x_i \ge t\) with \(x_i-t\), so long as \(x_i-t \notin X\). By Lemma 2, \(X_0\) is a \(\beta \)-set for \({{\,\textrm{core}\,}}_t(r(\lambda ))\).

By construction, \(X_0 \in \underline{\mathcal {R}}_t\), with \(\rho _t(X)=\rho _t(X_0)\). By the above, we must have \(c_t (\rho _t(X))=X_0\). It follows that \(R(c_t(\rho _t(X)))=\beta ({{\,\textrm{core}\,}}_t(r(\lambda )))\), and the proposition follows. \(\square \)

Example 6

Let \(t=6\). For \(\lambda = (5,4,3,1)\), \(X = H_\lambda = \{8,6,4,1\}\). Put \(F=\rho _t(X)\). Then \({{\,\textrm{supp}\,}}F=\{0,1,2,4\}\), and F takes value 1 at each point in its support. Thus,

$$\begin{aligned} c_t(X) = \{0\} \cup \{1\} \cup \{2\} \cup \{4\}=\{4,2,1,0\}, \end{aligned}$$

and therefore

$$\begin{aligned} \begin{aligned} {{\,\textrm{core}\,}}_6(5,4,3,1)&= \beta ^{-1}(R({{\,\textrm{Core}\,}}_6(X))) \\&= \beta ^{-1}(\{ 1\}) \\&= (1). \end{aligned} \end{aligned}$$

For a partition \(\lambda \) of length no greater than k, let

$$\begin{aligned} H_{\lambda ,t}^k=\rho _t(H_\lambda ^k) \in \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/t \mathbb {Z}}{k}\!\big ). \end{aligned}$$
(4)

Proposition 2

The map \(\mathscr {A}_t: \mathcal {C}_t^k \rightarrow \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/t \mathbb {Z}}{k}\!\big )\) taking \(\lambda \mapsto H_{\lambda , t}^k\) is a bijection. Thus,

$$\begin{aligned} \# \mathcal {C}_t^k=\left( {\begin{array}{c}k+t-1\\ k\end{array}}\right) . \end{aligned}$$

(Compare [13, Theorem 2.4].)

Proof

We have

$$\begin{aligned} \mathscr {A}_t=\rho _t \circ \beta \circ u^k. \end{aligned}$$

Let us see that

$$\begin{aligned} \mathscr {A}_t^{-1}=r \circ \beta ^{-1} \circ c_t: \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/t \mathbb {Z}}{k}\!\big )\rightarrow \mathcal {C}_t^k. \end{aligned}$$
(5)

is in fact inverse to \(\mathscr {A}_t\). On the one hand,

$$\begin{aligned} \begin{aligned} \rho _t \, \beta \, u^k \, r \, \beta ^{-1}\, c_t&= \rho _t \, U^k\, R\, c_t \\&= \rho _t \, c_t \\&= {{\,\textrm{id}\,}}\hbox { on}\ \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/t \mathbb {Z}}{k}\!\big ). \\ \end{aligned} \end{aligned}$$

On the other hand,

$$\begin{aligned} \begin{aligned} r \,\beta ^{-1} \, c_t \, \rho _t \, \beta \, u^k&= \beta ^{-1} \, R \,c_t \,\rho _t\, \beta \, u^k \\&= {{\,\textrm{core}\,}}_t \circ \, r \, u^k \\&={{\,\textrm{core}\,}}_t \\&= {{\,\textrm{id}\,}}\hbox { on}\ \mathcal {C}_t^k. \end{aligned} \end{aligned}$$

\(\square \)

Note that

$$\begin{aligned} H^k_{{{\,\textrm{core}\,}}_t \lambda ,t}=H_{\lambda ,t}^k. \end{aligned}$$

Lemma 3

For \(i \ge \ell (\lambda )\), we have

$$\begin{aligned} H_{\lambda ,t}^{i+t}(j) = H_{\lambda ,t}^i(j) + 1. \end{aligned}$$

By definition,

$$\begin{aligned} \begin{aligned} H_{\lambda }^{i+t}&= Z^t(H_\lambda ^i) \\&= (H_{\lambda }^i +t) \cup \{t-1, t-2, \ldots , 0\}.\\ \end{aligned} \end{aligned}$$

Hence, the multiplicity of j in \((H_{\lambda }^{i+t} \mod t)\) is one more than its multiplicity in \(H_{\lambda }^i\).

4 Reducing a t-core modulo a divisor of t

In this section, we enumerate the fibres of the retractions

$$\begin{aligned} {{\,\textrm{core}\,}}_b: \mathcal {C}_a^k \rightarrow \mathcal {C}_b^k, \end{aligned}$$

when b is a divisor of a. In particular, we demonstrate that the size of these fibres is quasipolynomial in k. This could be regarded as a warmup for our main theorems.

Definition 6

A function \(f: \mathbb {N} \rightarrow \mathbb {Q}\) is a quasipolynomial, provided that there exists a positive integer p so that for each \(0 \le i <p\), the function

$$\begin{aligned} n \mapsto f(i+np) \end{aligned}$$

where \(n \in \underline{\mathbb {N}}\) is a polynomial. The degree of f is the maximum of the degrees of these polynomials. The integer p is a period of f.

This definition is equivalent to the one in [11, Sect. 4.4].

Let

$$\begin{aligned} f_b^a: \mathbb {Z}/a\mathbb {Z} \rightarrow \mathbb {Z}/b\mathbb {Z} \end{aligned}$$

be the usual remainder mod b map, and let

$$\begin{aligned} \rho _b^a=(f_b^a)_*: \mathcal {M}_{{{\,\textrm{fin}\,}}}(\mathbb {Z}/a \mathbb {Z}) \rightarrow \mathcal {M}_{{{\,\textrm{fin}\,}}}( \mathbb {Z}/b\mathbb {Z}) \end{aligned}$$

be the induced map on multisets. We use the same notation for the restriction

$$\begin{aligned} \rho _b^a: \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/a \mathbb {Z}}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{\mathbb {Z}/b \mathbb {Z}}{k}\!\big ). \end{aligned}$$

Proposition 3

The following diagram commutes:

figure e

Proof

Going down, then right, then up the diagram is the composition

$$\begin{aligned} \begin{aligned} \mathscr {A}_b^{-1}\, \rho _b^a \, \mathscr {A}_a&=r \, \beta ^{-1} \, c_b\, \rho _b^a \, \rho _a \, \beta \, u^k \\&= \beta ^{-1} R \, c_b \, \rho _b \, \beta \, u^k \\&={{\,\textrm{core}\,}}_b. \\ \end{aligned} \end{aligned}$$

(We have used Proposition 1 and Eq. (5).) \(\square \)

Lemma 4

For \(G \in \mathcal {M}_{{{\,\textrm{fin}\,}}}(\mathbb {Z}/b\mathbb {Z})\), we have

$$\begin{aligned} \# (\rho ^a_b)^{-1}(G)=\prod _{j \in \mathbb {Z} / b \mathbb {Z}} \big (\!\genfrac(){0.0pt}1{\frac{a}{b}}{G(j)}\!\big ). \end{aligned}$$

Proof

This follows from Lemma 1. \(\square \)

Given \(\sigma \in \mathcal {C}_b\), let

$$\begin{aligned} N_{\sigma }(k) =\# \{\lambda \in \mathcal {C}_{a} \mid {{\,\textrm{core}\,}}_b \lambda = \sigma , \ell (\lambda ) \le k\}. \end{aligned}$$

Theorem 5

There is a quasipolynomial \(Q_{\sigma }(k)\) of degree \(a-b\) and period b, so that for \(k \ge \ell (\sigma )\), we have \(N_{\sigma }(k)=Q_{\sigma }(k)\). The leading coefficient of \(Q_\sigma (k)\) is \(\dfrac{1}{(\frac{a}{b}-1)!^{b}}\).

Proof

Let \(c=\frac{a}{b}\). By Proposition 3 and Lemma 4, for \(\ell (\sigma ) \le i < ~\ell (\sigma )+~b\), we have

$$\begin{aligned} N_{\sigma }(i + nb)&= \prod \limits _{j=0}^{b-1}\big (\!\genfrac(){0.0pt}1{c}{H_{\sigma ,b}^{i+nb}(j)}\!\big ) \\&= \prod \limits _{j=0}^{b-1} \big (\!\genfrac(){0.0pt}1{c}{H_{\sigma ,b}^{i}(j) + n}\!\big ) \\&= \prod \limits _{j=0}^{b-1}\left( {\begin{array}{c}n+ H_{\sigma ,b}^{i}(j) + c-1\\ H_{\sigma ,b}^{i}(j) + n\end{array}}\right) \\&= \prod \limits _{j=0}^{b-1}\left( {\begin{array}{c}n+ H_{\sigma ,b}^{i}(j) + c-1\\ c-1\end{array}}\right) .\\ \end{aligned}$$

Now each

$$\begin{aligned} \left( {\begin{array}{c}n+ H_{\sigma ,b}^{i}(j) +c-1\\ c-1\end{array}}\right) \end{aligned}$$

is a polynomial function of n of degree \(c-1\) and leading term

$$\begin{aligned} \frac{n^{c-1}}{(c-1)!}. \end{aligned}$$

Therefore, \(N_{\sigma }(i + nb)\) is a polynomial in n of degree \(a-b\) and leading coefficient \(\dfrac{1}{(\frac{a}{b}-1)!^{b}}\). Thus, the restriction of \(N_{\sigma }(k)\) to the coset \(i+b \underline{\mathbb {N}}\) is a polynomial, and the theorem follows.

This shows that for \(k \ge \ell (\sigma )\), \(N_{\sigma }(k)\) is a quasipolynomial of degree \(a-b\) and leading coefficient \(\dfrac{1}{(\frac{a}{b}-1)!^{b}}\). \(\square \)

Example 7

Let \(a=6, b=2\), and \(\sigma = (4,3,2,1) \in \mathcal {C}_2\). Then \(\ell (\sigma ) = 4\) and \(c = \frac{a}{b}=3.\) We have

$$\begin{aligned} H_{\sigma }^4 = \{7,5,3,1\} \text { and }H_{\sigma }^5 = \{8,6,4,2,0\}. \end{aligned}$$

Hence, \(H_{\sigma ,2}^4(j) ={\left\{ \begin{array}{ll} 0\text { for } j =0\\ 4\text { for } j =1 \end{array}\right. }\) and \(H_{\sigma ,2}^5(j) ={\left\{ \begin{array}{ll} 5\text { for } j =0\\ 0\text { for } j =1. \end{array}\right. }\)

By Theorem 5, for \(n \ge 0\),

$$\begin{aligned} N_\sigma (4+2n)&= \left( {\begin{array}{c}n+ 2\\ 2\end{array}}\right) \left( {\begin{array}{c}n+ 6\\ 2\end{array}}\right) \\&= \frac{1}{4}(n^4 +14n^3 + 65n^2 +112n + 60) \end{aligned}$$

and

$$\begin{aligned} N_\sigma (5+2n)&= \left( {\begin{array}{c}n+ 7\\ 2\end{array}}\right) \left( {\begin{array}{c}n+ 2\\ 2\end{array}}\right) \\&= \frac{1}{4}(n^4 +16n^3 + 83n^2 + 152n + 84). \end{aligned}$$

5 Converting to a multiset matching problem

In this section, we recall the map \({{\,\textrm{core}\,}}_{s,t}\) from the introduction and interpret the fibre counting problem in terms of multisets. By the usual Chinese Remainder Theorem, we may view \(\mathbb {Z}/m\mathbb {Z}\) as the fibre product of \(\mathbb {Z}/s\mathbb {Z}\) and \(\mathbb {Z}/t\mathbb {Z}\) over \(\mathbb {Z}/d\mathbb {Z}\). So we then investigate the effect of the functor \(S \leadsto \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\) on a fibre product. This study allows us to express  \(N_{\sigma , \tau }(k)\) in terms of classical combinatorial constants arising in margin problems for integral matrices. Moreover, we give a factorization of \(N_{\sigma , \tau }(k)\), which allows a reduction to the case where st are relatively prime.

5.1 The map \({{\,\textrm{core}\,}}_{s,t}\)

Let \(s, t \in \mathbb {N}\), and put \(d=\gcd (s,t)\) and \(m={{\,\textrm{lcm}\,}}(s,t)\). Consider the map

$$\begin{aligned} {{\,\textrm{core}\,}}_{s,t}: \mathcal {C}_{m} \rightarrow \mathcal {C}_s \times \mathcal {C}_t \end{aligned}$$

taking an m-core \(\lambda \) to \(({{\,\textrm{core}\,}}_s \lambda , {{\,\textrm{core}\,}}_t \lambda )\). As in Proposition 3, we have a commutative diagram:

figure f

where the maps out of \(\mathcal {C}_m^k\) and \(\mathcal {C}_s^k \times \mathcal {C}_t^k\) are the bijections of Proposition 2, and

$$\begin{aligned} \rho _{s,t}= \rho ^m_s \times \rho ^m_t. \end{aligned}$$

Let \(N_{\sigma , \tau }(k)\) be the cardinality of the fibre of \({{\,\textrm{core}\,}}_{s,t}\) over \((\sigma , \tau )\) for \(k \in \mathbb {N}\). Thus,

$$\begin{aligned} N_{\sigma , \tau }(k)= \# \{\lambda \in \mathcal {C}_{m}^k \mid {{\,\textrm{core}\,}}_s \lambda = \sigma , {{\,\textrm{core}\,}}_t \lambda = \tau \}. \end{aligned}$$

By the commutativity of (6), counting fibres of \({{\,\textrm{core}\,}}_{s,t}\) is equivalent to counting fibres of \(\rho _{s,t}\).

5.2 Matchings

For finite sets ST, consider the projection maps \({{\,\textrm{pr}\,}}_S: S \times T \rightarrow S\) and \({{\,\textrm{pr}\,}}_T:~S \times ~T \rightarrow ~T\). There are corresponding multiset maps

$$\begin{aligned} ({{\,\textrm{pr}\,}}_S)_*: \big (\!\genfrac(){0.0pt}1{S \times T}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{S}{k}\!\big ), ({{\,\textrm{pr}\,}}_T)_*: \big (\!\genfrac(){0.0pt}1{S \times T}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{T}{k}\!\big ). \end{aligned}$$

and

$$\begin{aligned} {{\,\textrm{pr}\,}}: \big (\!\genfrac(){0.0pt}1{S \times T}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\times \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\end{aligned}$$

given by \({{\,\textrm{pr}\,}}= ({{\,\textrm{pr}\,}}_S)_* \times ({{\,\textrm{pr}\,}}_T)_*.\)

Definition 7

Let \(F \in \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\) and \(G \in \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\). We say that \(\Phi \in \big (\!\genfrac(){0.0pt}1{S \times T}{k}\!\big )\) is a matching from F to G, provided \({{\,\textrm{pr}\,}}(\Phi ) = (F, G)\).

Say \(\mid S \mid =m\) and \(\mid T \mid =n\), with \(S=\{x_1, \ldots , x_m\}\) and \(T=\{y_1, \ldots , y_n\}\), Given FG as above, define vectors

$$\begin{aligned} \vec {F}=(F(x_1), \ldots , F(x_m)) \end{aligned}$$

and

$$\begin{aligned} \vec {G}=(G(y_1), \ldots , G(y_n)). \end{aligned}$$

So k is the sum of the components of \(\vec {F}\), and also the sum of the components of \(\vec {G}\).

One says that an \(m \times n\) matrix A has row margins \(\vec {F}\), if \(F(x_i)\) is the sum of the entries of the ith row for each i. Similarly A has column margins \(\vec {G}\), if \(G(y_i)\) is the sum of the entries of the jth column for each  j.

Proposition 4

Given \(F \in \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\) and \(G \in \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\), there is a bijection between the set of matchings from F to G and the set of nonnegative integral matrices with row margins \(\vec {F}\) and column margins \(\vec {G}\).

Proof

Suppose that \((m_{ij})\) is such a matrix. Then

$$\begin{aligned} \Phi (x_i, y_j)=m_{ij} \end{aligned}$$

is a matching from F to G, and this gives the required bijection. \(\square \)

Write \(M_{F,G}\) for the number of matrices with nonnegative integer entries having row margins \(\vec {F}\) and column margins \(\vec {G}\). According to [3, Corollary 8.1.4], if the sum of the components of \(\vec {F}\) is equal to the sum of the components of \(\vec {G}\), then \(M_{F,G} \ge 1\).

Corollary 1

The cardinality of the fibre of \({{\,\textrm{pr}\,}}\) over (FG) is \(M_{F, G}\). In particular, \({{\,\textrm{pr}\,}}\) is surjective.

5.3 Coprime case

In this subsection, let st be relatively prime, and set \(m=st\). Put \(S=\mathbb {Z}/s\mathbb {Z}\), \(T=\mathbb {Z}/t\mathbb {Z}\), and \(M=\mathbb {Z}/m\mathbb {Z}\). The Chinese Remainder Theorem gives a bijection

$$\begin{aligned} \mathscr {S}: M \overset{\sim }{\rightarrow }\ S \times T \end{aligned}$$

and for each \(n \ge 0\), the map \(\rho _{s,t}\) is the composition

$$\begin{aligned} \bigg (\!\!\genfrac(){0.0pt}0{M}{n}\!\!\bigg ) \overset{\mathscr {S}_*}{\rightarrow }\ \bigg (\!\!\genfrac(){0.0pt}0{S \times T}{n}\!\!\bigg ) \overset{{{\,\textrm{pr}\,}}}{\rightarrow }\ \bigg (\!\!\genfrac(){0.0pt}0{S}{n}\!\!\bigg ) \times \bigg (\!\!\genfrac(){0.0pt}0{T}{n}\!\!\bigg ). \end{aligned}$$

Now let \(\sigma \in \mathcal {C}_s\), and \(\tau \in \mathcal {C}_t\). Put \(\ell _0 = \max (\ell (\sigma ), \ell (\tau ))\) and fix \(i \ge \ell _0\). For each \(k \ge 0\), the bijection

$$\begin{aligned} \mathscr {A}_s: \mathcal {C}_s^{i+mk} \overset{\sim }{\rightarrow }\ \bigg (\!\!\genfrac(){0.0pt}0{S}{i+mk}\!\!\bigg ) \end{aligned}$$

of Proposition 2 maps \(\sigma \) to

$$\begin{aligned} F^k:=H_{\sigma ,s}^{i+mk}, \end{aligned}$$

with notation as in (4). Similarly \(\mathscr {A}_t: \mathcal {C}_t^{i+mk} \overset{\sim }{\rightarrow }\ \bigg (\!\!\genfrac(){0.0pt}0{T}{i+mk}\!\!\bigg )\) maps \(\tau \) to

$$\begin{aligned} G^k:=H_{\tau ,t}^{i+mk}. \end{aligned}$$

Note that \(\mathscr {S}_*\) is a bijection. By Corollary 1, we have

$$\begin{aligned} N_{\sigma ,\tau }(i+mk) = M_{F^k,G^k}. \end{aligned}$$

Moreover by Lemma 3, we know

$$\begin{aligned} F^k(j) = H_{\sigma , s}^i(j) + tk \text { and } G^k(j) = H_{\tau ,t}^i(j) + sk. \end{aligned}$$

Putting all this together:

Theorem 6

When st are relatively prime, then for \(i \ge \ell _0\), we have

$$\begin{aligned} N_{\sigma ,\tau }(i+stk)=M_{F^k,G^k}, \end{aligned}$$

where

$$\begin{aligned} \vec {F}^k =(a_{0i}, a_{1i}, \ldots , a_{(s-1)i}) +kt(\underbrace{1,1,\ldots , 1}_{s\text { times}}) \end{aligned}$$

and

$$\begin{aligned} \vec {G}^k = (b_{0i}, b_{1i}, \ldots , b_{(t-1)i})+ks(\underbrace{1,1,\ldots , 1}_{t\text { times}}), \end{aligned}$$

with \(a_{ji} = H_{\sigma , s}^i(j)\) and \(b_{ji}=H_{\tau ,t}^i(j)\).

5.4 A factorization in the noncoprime case

In this subsection, we “factor” \(N_{\sigma , \tau }\) into products of \(N_{\sigma ',\tau '}\) with the sizes of \(\sigma '\) and \(\tau '\) relatively prime.

Given sets STD and maps \(f: S \rightarrow D\) and \(g: T \rightarrow D\), we have the commutative diagram:

figure g

where

$$\begin{aligned} S \times _D T = \{(a,b) \in S \times T \mid f(a)=g(b)\} \end{aligned}$$

is the fibre product of f and g, and \(f', g'\) are projections to S and T. By applying the functor \(S \leadsto \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\) to (7), we get another commutative diagram:

figure h

where

$$\begin{aligned} \epsilon : \big (\!\genfrac(){0.0pt}1{S \times _D T}{k}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{S}{k}\!\big ) \times _{\big (\!\genfrac(){0.0pt}1{D}{k}\!\big )} \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\end{aligned}$$

is defined by

$$\begin{aligned} \epsilon (\Phi ) = (({{\,\textrm{pr}\,}}_S)_*(\Phi ), ({{\,\textrm{pr}\,}}_T)_*(\Phi )). \end{aligned}$$

Again, the maps \((f_*)'\) and \((g_*)'\) out of the fibre product \(\big (\!\genfrac(){0.0pt}1{S}{k}\!\big ) \times _{\big (\!\genfrac(){0.0pt}1{D}{k}\!\big )} \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\) are the projections.

Let \((F, G) \in \big (\!\genfrac(){0.0pt}1{S}{k}\!\big )\times \big (\!\genfrac(){0.0pt}1{T}{k}\!\big )\) such that \(f_*(F) = g_*(G)\). For \(j \in D\), let \(S_j\) and \(T_j\) be the fibres of f and g over j, respectively. Write \(F_j\) for the restriction of F to \(S_j\), and \(G_j\) for the restriction of G to \(T_j\).

Proposition 5

The cardinality of the fibre of \(\epsilon \) over (FG) is \(\prod \limits _{j \in D} M_{F_j, G_j}\). In particular, \(\epsilon \) is surjective.

Proof

Let \(k_j=\mid F_j \mid \). Then

$$\begin{aligned} k_j = \sum \limits _{s \in S_j}F(s) = f_*(F)(j) = g_*(G)(j) = \sum \limits _{t \in T_j}G(t) = \mid G_j \mid . \end{aligned}$$

For each \(j \in D\), we have a surjective map

$$\begin{aligned} {{\,\textrm{pr}\,}}_j: \big (\!\genfrac(){0.0pt}1{S_j \times T_j}{k_j}\!\big )\rightarrow \big (\!\genfrac(){0.0pt}1{S_j}{k_j}\!\big )\times \big (\!\genfrac(){0.0pt}1{T_j}{k_j}\!\big )\end{aligned}$$

as before.

For each \(j \in D\), pick a multiset \(\Phi _j\) in the fibre of \({{\,\textrm{pr}\,}}_j\) over \((F_j, G_j)\). This can be done in \(M_{F_j, G_j}\) ways (Corollary 1). Now define the multiset \(\Phi \in \big (\!\genfrac(){0.0pt}1{S \times _D T}{k}\!\big )\) as follows:

$$\begin{aligned} \Phi (s,t) = \Phi _j(s,t) \text { if } (s,t) \in S_j \times T_j. \end{aligned}$$

The cardinality of \(\Phi \) is

$$\begin{aligned} \mid \Phi \mid = \sum \limits _{j \in D}\sum \limits _{(s,t) \in S_j \times T_j}\mid \Phi _j(s,t) \mid = \sum \limits _{j \in D} k_j = k, \end{aligned}$$

as required. From the construction of \(\Phi \), it is clear that \(\epsilon (\Phi ) = (F, G)\). \(\square \)

Theorem 7

Let \(s,t \in \mathbb {N}\), and put \(\gcd (s,t) =d\) and \({{\,\textrm{lcm}\,}}(s,t) =m\). Suppose \(\sigma \in \mathcal {C}_s\) and \(\tau \in \mathcal {C}_t\) with \({{\,\textrm{core}\,}}_d(\sigma )={{\,\textrm{core}\,}}_d(\tau )\). Then for \(i \ge \ell _0\) and \(0 \le j < d\), there exist \(\frac{s}{d}\)-cores \(\sigma _j^i\), \(\frac{t}{d}\)-cores \(\tau _j^i\) and nonnegative integers \(\ell _j^i\) such that for all \(k \ge 0\), we have

$$\begin{aligned} N_{\sigma , \tau }(i +mk)= \prod _{j=0}^{d-1} N_{\sigma _{j}^i,\tau _{j}^i} \left( \ell _{j}^i + \frac{m}{d}k \right) . \end{aligned}$$

Proof

As above, we write \((H_{\sigma ,s}^{i+mk})_j\) for the restriction of the multiset \(H_{\sigma ,s}^{i+mk}\) to

$$\begin{aligned} (\mathbb {Z} / s \mathbb {Z})_j= \{ x \in \mathbb {Z} / s \mathbb {Z}\mid x \equiv j \mod d \}. \end{aligned}$$

Put \(F_j^k=(H_{\sigma ,s}^{i+mk})_j\) and \(G_j^k=(H_{\tau ,t}^{i+mk})_j\). Then by the commutative diagram (6) and Proposition 5, we have

$$\begin{aligned} N_{\sigma , \tau }(i+mk) = \prod \limits _{j=0}^{d-1}M_{F_j^k, G_j^k} \end{aligned}$$

for \(i \ge \ell _0\). Via Proposition 2, define the \(\frac{s}{d}\)-core \(\sigma _j^i\) so that

$$\begin{aligned} H_{\sigma _j^i, \frac{s}{d}}^{l_j^i} = F_j^0, \end{aligned}$$

and the \(\frac{t}{d}\)-core \(\tau _j^i\) by

$$\begin{aligned} H_{\tau _j^i, \frac{t}{d}}^{l_j^i} = G_j^0 \end{aligned}$$

where \(l_j^i = \mid F_j^0 \mid = \mid G_j^0 \mid .\) Then again by the commutative diagram and Corollary 5 in the relatively prime case,

$$\begin{aligned} N_{\sigma _{j}^i,\tau _{j}^i}\left( \ell _{j}^i + \frac{m}{d}k \right) = M_{F_j^k, G_j^k}. \end{aligned}$$

This completes the proof. \(\square \)

Example 8

Let \(s =4, t =6\) and \(\sigma = (3,1,1), \tau = (3,2)\). Then \(d = 2, m =12\), \(H_{\sigma } = \{5,2,1\}\), \(H_{\tau } = \{4,2\}\), and \(\ell _0 =3\). Let \(F_j^k\) and \(G_j^k\) be the multisets as in the theorem above.

For \(i=12\),

$$\begin{aligned} F_0^k = (3k+3, 3k+4),{} & {} G_0^k = (2k+3, 2k+3, 2k+1),{} & {} \\ F_1^k = (3k+2,3k+3),{} & {} G_1^k = (2k+2, 2k+2,2k+1),{} & {} \\ \sigma _0^{12} = (1),{} & {} \tau _0^{12} =(1,1),{} & {} \ell _0^{12}= 7,\\ \sigma _1^{12} = (1),{} & {} \tau _1^{12} =\emptyset ,{} & {} \ell _1^{12}=5. \end{aligned}$$

Thus,

$$\begin{aligned} N_{\sigma , \tau }(12 + 12k) = N_{(1),(1,1)}(7+6k) \cdot N_{(1),\emptyset }(5+6k). \end{aligned}$$

We will continue with this in Example 13.

6 Preliminaries for polytopes

We now review notions concerning polytopes which we will need. A suitable reference is [11, Sect. 4.6.2].

6.1 Basic terminology

Given an \(m \times n\) matrix A and a vector \(\vec {b} \in \mathbb {R}^m\), we define the polyhedron:

$$\begin{aligned} \mathcal {P}(A, \vec {b}) = \{\vec {x} \in \mathbb {R}^n \mid A\vec {x} \le \vec {b}, \vec {x} \ge 0\}. \end{aligned}$$

Following convention, ‘\(\vec {v}_1 \le \vec {v}_2\)’ means that each component of \(\vec {v}_1\) is less than or equal to the corresponding component of \(\vec {v}_2\).

Definition 8

We say that the pair \((A, \vec {b})\) is of bounded type, provided \(\mathcal {P}(A, \vec {b})\) is bounded. A bounded polyhedron is called a polytope.

Definition 9

The dimension of a polytope, \(\dim (\mathcal {P})\), is the dimension of the affine space spanned by \(\mathcal {P}\):

$$\begin{aligned} {{\,\textrm{ASpan}\,}}(\mathcal {P}) = \{\vec {x} + \lambda (\vec {y}- \vec {x}) \mid \vec {x}, \vec {y} \in \mathcal {P},\lambda \in \mathbb {R}\} \end{aligned}$$

When \(\dim (\mathcal {P}) = d\), we call it a d-polytope.

Write \(\textrm{conv}(\{\vec {v}_1, \vec {v}_2, \ldots , \vec {v}_m\})\) for the convex hull of \(\{\vec {v}_1, \vec {v}_2, \ldots , \vec {v}_m\} \subset \) \(\mathbb {R}^n\).

Definition 10

A convex polytope \(\mathcal {P}\) in \(\mathbb {R}^n\) is the convex hull of an affine independent set \(\{\vec {v}_1, \vec {v}_2, \ldots , \vec {v}_m\} \subset \mathbb {R}^n\), called the vertices of \(\mathcal {P}\). If all vertices of \(\mathcal {P}\) have integer coordinates, then it is called a lattice polytope.

Lemma 5

Let A be an \(m \times n\) matrix and \(\vec {b}, \vec {c} \in \mathbb {R}^m\). If \(\mathcal {P}(A, \vec {b})=\emptyset \), then \(\mathcal {P}(A,\vec {b}k+ \vec {c})=\emptyset \) for \(k \gg 0\).

Proof

For a matrix A and a vector \(\vec {b}\), the inequality \(A \vec {x} \le \vec {b}\) has a solution for \(\vec {x}\), if and only if \(\vec {y} \cdot \vec {b} \ge 0\) for each row vector \(\vec {y} \ge \vec {0}\) with \(\vec {yA} = \vec {0}\) [10, Corollary 7.1 e, Farkas’ Lemma (variant)]. By the hypothesis, there exists such a \(\vec {y}\) with \(\lnot (\vec {y} \cdot \vec {b} \ge 0)\). Therefore, for some i, the ith component \(y_i\) of \(\vec {y}\) is positive, and the ith component \(b_i\) of \(\vec {b}\) is negative. But then for k large

$$\begin{aligned} y_i(b_ik+c_i)<0, \end{aligned}$$

where \(c_i\) is the ith component of \(\vec {c}\). Therefore, \(\mathcal {P}(A,\vec {b}k+ \vec {c})=\emptyset \). \(\square \)

Lemma 6

Let A be an \(m \times n\) matrix and \(\vec {b}, \vec {b}' \in \mathbb {R}^m\). Suppose \(\mathcal {P}(A, \vec {b}) \ne \emptyset \). Then, \(\mathcal {P}(A,\vec {b})\) is bounded iff \(\mathcal {P}(A,\vec {b}')\) is bounded.

Proof

The characteristic cone of a nonempty polytope \(\mathcal {P}\) is defined as follows:

$$\begin{aligned} {{\,\textrm{char}\,}}{{\,\textrm{cone}\,}}\mathcal {P} = \{\vec {y} \mid \vec {x}+\vec {y} \in \mathcal {P} \text {for all} \vec {x} \in \mathcal {P}\} = \{\vec {y} \mid A\vec {y} \le \vec {0}\}. \end{aligned}$$

The nonempty polytope \(\mathcal {P}\) is bounded if and only if \({{\,\textrm{char}\,}}{{\,\textrm{cone}\,}}\mathcal {P} = \{0\}\) [10, p. 100, (5)]. The \({{\,\textrm{char}\,}}{{\,\textrm{cone}\,}}\mathcal {P}\) does not depend on \(\vec {b}\), and hence, the boundedness of the polytope \(\mathcal {P}(A, \vec {b})\) does not depend on \(\vec {b}\). \(\square \)

Definition 11

A matrix A is said to be totally unimodular, provided the determinant of each square submatrix of A is \(+1\), \(-1\), or 0.

Proposition 6

( [10, Corollary 19.2a, Hoffman and Kruskal’s Theorem]) Let A be an integral matrix. Then A is totally unimodular if and only if for each integral vector \(\vec {b}\) the polyhedron \(\{\vec {x} \mid A\vec {x} \le \vec {b}, \vec {x} \ge 0\}\) is integral.

6.2 Relative volume

When \(\mathcal {P} \subset \mathbb {R}^n\) is a lattice polytope, not necessarily of dimension  n, there is yet a “relative volume” of \(\mathcal {P}\), which we recall from [11, Sect. 4.6]. Let \(d=\dim \mathcal {P}\).

Since \(\mathcal {P}\) is a lattice polytope, the intersection of \({{\,\textrm{ASpan}\,}}(\mathcal {P})\) with \(\mathbb {Z}^n\) is a translation of a free abelian group of rank d. Therefore, there is an affine isomorphism

$$\begin{aligned} T: {{\,\textrm{ASpan}\,}}(\mathcal {P}) \xrightarrow {\sim } \mathbb {R}^d \end{aligned}$$

with

$$\begin{aligned} T({{\,\textrm{ASpan}\,}}(\mathcal {P}) \cap \mathbb {Z}^n) \xrightarrow {\sim } \mathbb {Z}^d. \end{aligned}$$

The relative volume of \(\mathcal {P}\) is the volume of \(T(\mathcal {P})\), and is independent of the choice of T. Of course, when \(\dim (\mathcal {P}) = n\), the relative volume agrees with the usual volume.

6.3 Transportation polytopes

Let \(\vec {r} =(r_1, r_2, \ldots , r_s)\) and \(\vec {c} =(c_1, c_2, \ldots , c_t)\) be vectors whose components are nonnegative integers, and with \(\sum r_i=\sum c_j\). The nonnegative real matrices with row sum \(r_i\) and column sum \(c_j\) form a polytope \(\mathcal {M}(\vec {r}, \vec {c})\) called the transportation polytope for margins \(\vec {r}\) and  \(\vec {c}\). According to [3, Theorem 8.1.1], this polytope has dimension \((s-1)(t-1)\). By [8, Sect. 2], \(\mathcal {M}(\vec {r}, \vec {c})\) is a lattice polytope. Write \({{\,\textrm{Mat}\,}}_{s,t}\) for the set of \(s \times t\) real matrices. Let \(\pi : {{\,\textrm{Mat}\,}}_{s,t} \rightarrow {{\,\textrm{Mat}\,}}_{s-1, t-1}\) be the map defined by omitting the last row and column. We put

$$\begin{aligned} \mathcal {M}'(\vec {r},\vec {c})=\pi ( \mathcal {M}(\vec {r},\vec {c})). \end{aligned}$$

Proposition 7

The polytope \(\mathcal {M}'(\vec {r},\vec {c})\) has dimension \((s-1)(t-1)\). It takes the form \(P(A,\vec {b})\), where A is a totally unimodular matrix, and \((A,\vec {b})\) is of bounded type. The integer points of \(\mathcal {M}(\vec {r},\vec {c})\) are mapped bijectively by \(\pi \) onto the integer points of \(\mathcal {M}'(\vec {r},\vec {c})\). The volume of \(\mathcal {M}'(\vec {r},\vec {c})\) is the relative volume of \(\mathcal {M}(\vec {r},\vec {c})\).

Proof

The polytope \(\mathcal {M}'(\vec {r},\vec {c}) \subset {{\,\textrm{Mat}\,}}_{s-1, t-1}\) comprises the nonnegative solutions to the following \(s+t-1\) constraints:

$$\begin{aligned} \begin{aligned} \sum \limits _{j=1}^{t-1}x_{ij}&\le r_i \, \, \, \text { for } 1 \le i \le s-1\\ \sum \limits _{i=1}^{s-1}x_{ij}&\le c_j \, \, \, \text { for } 1 \le j \le t-1\\ - \sum \limits _{i=1}^{s-1}\sum \limits _{j=1}^{t-1}x_{ij}&\le r_s - \sum \limits _{j=1}^{t-1}c_j. \\ \end{aligned} \end{aligned}$$

In particular, we may write

$$\begin{aligned} \vec {b}=\left( r_1,\ldots , r_{s-1},c_1, \ldots , c_{t-1}, b_{s+t-1} \right) ^t, \end{aligned}$$

where

$$\begin{aligned} b_{s+t-1}= r_s-\sum _{j=1}^{t-1} c_j=c_t-\sum _{i=1}^{s-1} r_i. \end{aligned}$$

If A is the evident \((s+t-1) \times (s-1)(t-1)\) coefficient matrix, then \(\mathcal {M}'(\vec {r},\vec {c})=\mathcal {P}(A,\vec {b})\).

Conversely, given an integral vector \(\vec {b}_*=(b_1, \ldots , b_{s+t-1})^t \in \mathbb {Z}^{s+t-1}\), the polytope \(\mathcal {P}(A,\vec {b}_*)=\pi (\mathcal {M}(\vec {r}_*,\vec {c}_*))\), with

$$\begin{aligned} \vec {r}_*=(b_1, \ldots , b_{s-1}, \sum _{i=0}^{t-1}b_{s+i})^t \text { and } \vec {c}_*=(b_s, b_{s+1}, \ldots , b_{s+t-2}, b_{s+t-1}+\sum _{i=1}^{s-1} b_i)^t. \end{aligned}$$

Again by [8, Sect. 2], \(\mathcal {M}(\vec {r}_*, \vec {c}_*)\) is a lattice polytope, when \(\vec {r}_*,\vec {c}_*\) are nonnegative. (Otherwise, it is empty, still technically a lattice polytope.) Therefore, the projection \(\mathcal {P}(A, \vec {b}_*)\) is also a lattice polytope for each integral \(\vec {b}_*\). Proposition 6 now implies that the matrix A is totally unimodular.

Next, write \(\mathcal {A} \mathcal {M}(\vec {r}, \vec {c})\) for the set of real \(s \times t\) matrices with margins \(\vec {r}\) and \(\vec {c}\). One checks that

$$\begin{aligned} {{\,\textrm{ASpan}\,}}(\mathcal {M}(\vec {r}, \vec {c}))=\mathcal {A} \mathcal {M}(\vec {r}, \vec {c}), \end{aligned}$$

and moreover that the restriction

$$\begin{aligned} T: {{\,\textrm{ASpan}\,}}(\mathcal {M}(\vec {r}, \vec {c})) \xrightarrow {\sim } {{\,\textrm{Mat}\,}}_{s-1,t-1} \end{aligned}$$

of \(\pi \) is an affine isomorphism, giving a bijection on integer points. This gives the dimension and relative volume assertions. Boundedness is clear. \(\square \)

Example 9

Let \(\mathcal {P}\) be the transportation polytope for row margins (2, 2, 2) and column margins (3, 3). Then \({{\,\textrm{ASpan}\,}}(\mathcal {P})\) is the affine space of matrices of the form:

$$\begin{aligned} \begin{pmatrix} x &{} 2-x \\ y &{} 2-y \\ 3-x-y &{} x+y-1 \\ \end{pmatrix}, \end{aligned}$$
(8)

for \(x,y \in \mathbb {R}\), and \(\mathcal {P}\) is the subset of \({{\,\textrm{ASpan}\,}}(\mathcal {P})\) defined by the constraints \(1 \le x+y \le 3\) and \(0 \le x,y \le 2\).

The map T taking (8) to (xy) is an affine isomorphism to \(\mathbb {R}^2\), taking integer points to integer points. Then the relative volume of \(\mathcal {P}\), i.e. the volume of \(T(\mathcal {P})\), is the area of the region in Fig. 1, which is  3.

Fig. 1
figure 1

\(T(\mathcal {P})\)

Remark 4

It is notoriously difficult to compute such volumes in general. The transportation polytope for \(n \times n\) matrices with row and column margins \((1, \ldots , 1)\) is the famous Birkhoff polytope. Finding its volume is an open problem, see for instance, [4].

7 Counting integer points in lattice polytopes

In this section, we adapt the Ehrhart theory of counting integer points in lattice polytopes to accommodate our families of transportation polytopes.

Theorem 8

(Ehrhart, see [11, Corollary 4.6.11]) Let \(\mathcal {P}\) be a lattice d-polytope in \(\mathbb {R}^n\). Then the number of integer points in the polytope

$$\begin{aligned} k\mathcal {P} = \{k \vec \alpha \mid \vec \alpha \in \mathcal {P}\}, \end{aligned}$$

with k a positive integer, is a polynomial in k of degree d, with leading coefficient equal to the relative volume of \(\mathcal {P}\).

For \((A, \vec {b})\) of bounded type, write \(N(A, \vec {b})\) for the number of integer points in the polytope \(\mathcal {P}(A, \vec {b})\).

Proposition 8

Let A be an \(m \times n\) totally unimodular matrix and \(\vec {b} \in \mathbb {Z}^m\). Suppose \((A, \vec {b})\) is of bounded type and that \(\mathcal {P}(A,\vec {b}) \ne \emptyset \). Then there is a polynomial f(k) so that for positive integers k, we have \(N(A, \vec {b}k)=f(k)\). Moreover, \(\deg f=\dim (\mathcal {P}(A,\vec {b}))\) and the leading coefficient of f is the relative volume of \(\mathcal {P}(A,\vec {b})\).

Proof

By Proposition 6, \(\mathcal {P}(A,\vec {b}k)\) is a lattice polytope. Moreover, \(\mathcal {P}(A,\vec {b}k) =~k \mathcal {P}(A, \vec {b})\). Therefore, the conclusion is followed by Ehrhart’s Theorem. \(\square \)

Lemma 7

Let A be an \(m \times n\) totally unimodular matrix with \(a_{11} \ne 0\). Let \(A'\) be the matrix obtained by applying all the row operations:

$$\begin{aligned} R_i \mapsto R_i- a_{i1}a_{11}^{-1}R_1, \end{aligned}$$

for \(2 \le i \le m\). Then \(A'\) is totally unimodular.

This seems to be well known, but we provide a proof for the convenience of the reader.

Proof

Let \(I \subseteq \{1,2, \ldots , m\}\) and \(J \subseteq \{1,2, \ldots , n\}\), with \(\mid I \mid =\mid J \mid >0\). Let \(A_{IJ}\) denote the submatrix of A that corresponds to the rows with index in I and columns with index in J. We need to show that \(\det (A'_{IJ})\) is \(1, -1\) or 0.

Case 1: If \(1 \in I\), \(\det (A'_{IJ})= \det (A_{IJ}) = 1,-1\) or 0, since A is totally unimodular and the determinant remains unchanged under such a row operation.

Case 2: If \(1 \notin I\), \(1 \in J\), \(\det (A'_{IJ}) = 0\) since the first column of \(A'_{IJ}\) is 0.

Case 3: If \(1 \notin I\), \(1 \notin J\), let \(\tilde{I} = I \cup \{1\}\) and \(\tilde{J} = J \cup \{1\}\). Then \(\det (A'_{\tilde{I}\tilde{J}})~=~a_{11} \det (A'_{IJ})\). By Case 1, we see \(\det (A'_{\tilde{I}\tilde{J}})\) is 1, \(-1\) or 0.

Hence, \(A'\) is totally unimodular. \(\square \)

Lemma 8

Let A be an \(m \times n\) matrix, and \(\vec {b},\vec {c} \in \mathbb {R}^m\). Put

$$\begin{aligned} Z=\{ 1 \le i \le m \mid \hbox { the} i \hbox {th row of} A\hbox { is }0\}, \end{aligned}$$

and \(m_*=m-\mid Z \mid \). Let \(A_*\) be the \(m_* \times n\) matrix obtained by deleting the zero rows from A. Similarly form \(\vec {b}_*,\vec {c_*} \in \mathbb {R}^{m_*}\) by deleting the corresponding components from \(\vec {b}\) and \(\vec {c}\).

Then one of the following must hold:

  1. (1)

    \(\mathcal {P}(A,\vec {b}k+\vec {c})=\emptyset \) for \(k \gg 0\).

  2. (2)

    \(\mathcal {P}(A,\vec {b}k+\vec {c})=\mathcal {P}(A_*,\vec {b}_*k+\vec {c_*})\) for \(k \gg 0\).

Proof

If there exists \(i \in Z\) with \(b_i<0\), then \(\mathcal {P}(A,\vec {b})=\emptyset \), so (1) holds by Lemma 5. So we may assume that \(b_i \ge 0\) for all \(i \in Z\). If there exists \(i \in Z\) so that both \(c_i <0\) and \(b_i=0\), then \(\mathcal {P}(A,\vec {b}k+\vec {c})=\emptyset \) for all \(k \ge 0\). Otherwise, the zero rows of A correspond to inequalities \(0 \le b_ik+c_i\) with either \(b_i>0\), or \(b_i=0\) and \(c_i \ge 0\). For large k, these inequalities will hold, giving (2). \(\square \)

Theorem 9

Let A be an \(m \times n\) totally unimodular matrix and \(\vec {b}, \vec {c} \in \mathbb {Z}^m\). Suppose \(\mathcal {P}(A, \vec {b})\) is bounded. Then there is a polynomial f(k) with \(\deg f \le n\), such that for integers \(k \gg 0\), we have

$$\begin{aligned} N(A, \vec {b}k+\vec {c})=f(k). \end{aligned}$$

If \(\dim \mathcal {P}(A,\vec {b}) =n\), and none of the rows of A are 0, then \(\deg f = n\) and the leading coefficient of f is the volume of \(\mathcal {P}(A,\vec {b})\).

Proof

By Lemma 5, we may assume \(\mathcal {P}(A,\vec {b}) \ne \emptyset \).

Suppose first that A has at least one zero row. By Lemma 8, either \(N(A,~\vec {b}k~+~\vec {c})=0\) for \(k \gg 0\), or \(\mathcal {P}(A,\vec {b}k+\vec {c})=\mathcal {P}(A_*,\vec {b}_*k+\vec {c_*})\) for \(k \gg 0\). Since \(\mathcal {P}(A,\vec {b})=\mathcal {P}(A_*,\vec {b}_*)\), we may assume that none of the rows of A are 0 for the first statement of the theorem.

Let \(\vec {b} = (b_1, b_2, \ldots , b_m)^t\) and \(\vec {c} = (c_1, c_2, \ldots , c_m)^t\).

We proceed by induction on n. For \(n=1\), the matrix \(A=(a_1, \ldots , a_m)^t\) is a single column, with each \(a_i=\pm 1\). Moreover,,

$$\begin{aligned} \mathcal {P}(A,\vec {b}) =\{ x \in \mathbb {R} \mid a_i x \le b_i \, \forall i, x \ge 0 \}. \end{aligned}$$

Put \(I=\{ i \mid a_i=1\}\) and \(J= \{0\} \cup \{ j \mid a_{j} = -1\}\). Note that

$$\begin{aligned} \begin{aligned} \mathcal {P}(A,\vec {b}) \text { is bounded}&\Leftrightarrow I \ne \emptyset , \, \, \, \text { and } \\ \mathcal {P}(A, \vec {b}) \ne \emptyset&\Leftrightarrow -b_j \le b_i \, \forall i \in I, j \in J. \\ \end{aligned} \end{aligned}$$

Let \(B^-= \max \{-b_j \mid j \in J\}\), and \(B^+= \min \{b_i \mid i \in I\}\). Since \(\mathcal {P}(A,\vec {b})\) is bounded and nonempty, we have \(0 \le B^- \le B^+\), and may write

$$\begin{aligned} \mathcal {P}(A,\vec {b})=[B^-,B^+]. \end{aligned}$$

Therefore,

$$\begin{aligned} \dim \mathcal {P}(A,\vec {b})=1 \Leftrightarrow B^- < B^+. \end{aligned}$$

Now let \(C^-= \max \{-c_j \mid j \in J, \, -b_j= B^-\}\) and \(C^+ = \min \{c_i \mid i \in I, \, b_i=B^+\}\). If \(\dim \mathcal {P}(A,b)=1\), then for \(k \gg 0\), we have

$$\begin{aligned} \mathcal {P}(A,\vec {b}k + \vec {c})=[kB^-+C^-,kB^++C^+], \end{aligned}$$

so that

$$\begin{aligned} N(A, \vec {b}k+\vec {c}) = (B^+ - B^-)k + (C^+ - C^-) + 1. \end{aligned}$$

On the other hand, if \(\dim \mathcal {P}(A,\vec {b}) =0\), it is easy to see that

$$\begin{aligned} N(A, \vec {b}k+\vec {c}) = {\left\{ \begin{array}{ll} C^+ - C^- +1 &{}\text { if } C^+ >C^- \\ 0 &{}\text { if } C^+ \le C^-, \end{array}\right. } \end{aligned}$$

for \(k \gg 0\). From these calculations, we deduce the theorem when \(n=1\).

For \(n>1\), we further induct on the number of nonzero components of \(\vec {c}\). Let \(A=(a_{ij})\). If \(\vec {c}=\vec {0}\), then the conclusion follows from Proposition  8. So suppose \(\vec {c} \ne \vec {0}\). By permuting the rows, we may assume \(c_1 \ne 0\).

First, we consider the case where \(c_1 > 0\). We partition the integer points of \(\mathcal {P}(A,\vec {b}k+\vec {c})\) as follows. Consider the systems of inequalities:

$$\begin{aligned} \begin{array}{ccccccccc} a_{11}x_1 &{} + &{} a_{12}x_2 &{} + &{} \ldots &{} + &{} a_{1n}x_n &{} \le &{} b_1k\\ a_{21}x_1 &{} + &{} a_{22}x_2 &{} + &{} \ldots &{} + &{} a_{2n}x_n &{} \le &{} b_2k + c_2\\ \vdots &{} &{} \vdots &{} &{} \ldots &{} &{} \vdots &{} &{} \vdots \\ a_{m1}x_1 &{} + &{} a_{m2}x_2 &{} + &{} \ldots &{} + &{} a_{mn}x_n &{} \le &{} b_mk + c_m\\ \end{array} \end{aligned}$$
(9)

and

$$\begin{aligned} \begin{array}{ccccccccc} a_{11}x_1 &{} + &{} a_{12}x_2 &{} + &{} \ldots &{} + &{} a_{1n}x_n &{} = &{} b_1k + \ell \\ a_{21}x_1 &{} + &{} a_{22}x_2 &{} + &{} \ldots &{} + &{} a_{2n}x_n &{} \le &{} b_2k + c_2\\ \vdots &{} &{} \vdots &{} &{} \ldots &{} &{} \vdots &{} &{} \vdots \\ a_{m1}x_1 &{} + &{} a_{m2}x_2 &{} + &{} \ldots &{} + &{} a_{mn}x_n &{} \le &{} b_mk + c_m\\ \end{array} \end{aligned}$$
(10)

for \(\ell = 1,2, \ldots , c_1\). Write \(\mathcal {P}^0(k)\) for the nonnegative solutions to (9) and \(\mathcal {P}^\ell (k)\) for the nonnegative solutions to (10) for \(1 \le \ell \le c_1\). Then we have a disjoint union

$$\begin{aligned} \mathcal P(A,\vec {b}k+\vec {c}) \cap \mathbb {Z}^n= \coprod _{\ell =0}^{c_1} (\mathcal {P}^\ell (k) \cap \mathbb {Z}^n). \end{aligned}$$
(11)

The first row of A is nonzero, and we assume for simplicity that \(a_{11} \ne 0\). Solving the equality in (10) for \(x_1\) gives:

$$\begin{aligned} x_1 = a_{11}^{-1}\left( b_1k + \ell - \sum \limits _{j \ne 1}a_{1j}x_j \right) . \end{aligned}$$

Substituting this into the rest of (10) gives

$$\begin{aligned} \begin{array}{cccccc} a_{21}a_{11}^{-1} \left( b_1k + \ell - \sum \limits _{j\ne 1}a_{1j}x_j \right) &{} + &{} \ldots &{} + &{} a_{2n}x_n &{}\le b_2k + c_2 \\ \vdots &{} &{} \vdots &{} &{} \vdots &{} \vdots \\ a_{m1}a_{11}^{-1} \left( b_1k + \ell - \sum \limits _{j\ne 1}a_{1j}x_j \right) &{} + &{} \ldots &{} + &{} a_{mn}x_n &{} \le b_mk + c_m. \\ \end{array} \end{aligned}$$

for \(\ell = 1,2 \ldots , c_1\). To these inequalities we add

$$\begin{aligned} \sum \limits _{j \ne 1} a_{11}^{-1} a_{1j}x_j \le a_{11}^{-1}(b_1k+ \ell ), \end{aligned}$$

corresponding to the condition \(x_1 \ge 0\).

Write \(A'\) for the \(m \times (n-1)\) matrix obtained by first applying all the row operations \(R_i \mapsto R_i -a_{i1}a_{11}^{-1}R_1\) to A for \(2 \le i \le m\), removing the first column, and multiplying the first row by \(a_{11}^{-1}\). Then \(A'\) is totally unimodular by Lemma 7. Define \(\vec {b}' \in \mathbb {Z}^{m}\) by

$$\begin{aligned} \vec {b}' =(a_{11}^{-1} b_1, b_2-a_{21}a_{11}^{-1} b_1, \cdots , b_m-a_{m1}a_{11}^{-1} b_1)^t, \end{aligned}$$

and \(\vec {c}_{(\ell )} \in \mathbb {Z}^{m}\) by

$$\begin{aligned} \vec {c}_{(\ell )}=(a_{11}^{-1} \ell , c_2-a_{21} a_{11}^{-1} \ell , \ldots , c_m-a_{m1} a_{11}^{-1} \ell )^t. \end{aligned}$$

Eliminating the first component gives a projection from \(\mathbb {R}^n\) to \(\mathbb {R}^{n-1}\). This projection maps \(\mathcal {P}^\ell (k)\) bijectively to \(\mathcal {P}(A',\vec {b}'k+ \vec {c}_{(\ell )})\) and also gives a bijection on integer points.

Now \(\mathcal {P}(A, \vec {b}k + \vec {c})\) is bounded by Lemma 6. Therefore, the closed subset \(\mathcal {P}^\ell (k)\) is compact, and it follows that its image \(\mathcal {P}(A',\vec {b}' k+ \vec {c}_{(\ell )})\) is also bounded. By (11), we have

$$\begin{aligned} N(A,\vec {b}k+\vec {c})=N(A,\vec {b}k+\vec {c'}) + \sum _{\ell =1}^{c_1} N(A',\vec {b}'k+ \vec {c}_{(\ell )}), \end{aligned}$$
(12)

where \(\vec {c'}=(0,c_2,c_3,\ldots )^t\).

By our induction on nonzero components of \(\vec {c}\), we know that for \(k \gg 0\), \(N(A,~\vec {b}k~+~\vec {c'})=~g(k)\), where g is a polynomial with \(\deg g \le n\). Moreover, if \(\dim \mathcal {P}(A,\vec {b})=n\), then \(\deg g=n\), and its leading coefficient is the volume of \(\mathcal {P}(A,\vec {b})\).

For a given \(1 \le \ell \le c_1\), either \(\mathcal {P}(A',\vec {b}'k+ \vec {c}_{(\ell )}) = \emptyset \) for \(k \gg 0\), or

$$\begin{aligned} \mathcal {P}(A',\vec {b}'k+ \vec {c}_{(\ell )})=\mathcal {P}(A'_*,\vec {b}'_*k+ \vec {c}_{(\ell ),*}) \end{aligned}$$

by Lemma 8. In the first case, put \(f_{(\ell )}=0\). In the second case, \(A'_*\) has no zero rows. Therefore, by our induction on n, there are polynomials \(f_{(\ell )}\), with \(\deg f_{(\ell )} \le n-1\), so that for \(k \gg 0\) we have \(N(A',\vec {b}'k+\vec {c}_{(\ell )})=f_{(\ell )}\). Now

$$\begin{aligned} f=g+\sum _{\ell =1}^{c_1} f_{(\ell )} \end{aligned}$$

satisfies the conclusion of the theorem.

For the case where \(c_1<0\), consider (9) and (10), but with \(\ell = c_1+1, \ldots , 0\). The elimination procedure runs as before, but replacing (12) with

$$\begin{aligned} N(A,\vec {b}k+\vec {c}) + \sum _{\ell =c_1+1}^{0} N(A',\vec {b}' k+ \vec {c}_{(\ell )}) =N(A,\vec {b}k+\vec {c'}), \end{aligned}$$

and one takes

$$\begin{aligned} f=g-\sum _{\ell =c_1+1}^{0} f_{(\ell )}. \end{aligned}$$

(This time \(\mathcal {P}^\ell (k)\) is bounded because it is contained in \(\mathcal {P}(A,\vec {b}k+\vec {c'})\); thus, its projection \(\mathcal {P}(A',\vec {b}' k+\vec {c}_{(\ell )})\) is bounded.)

This completes the induction, and the theorem is proved. \(\square \)

Example 10

Let \(A=\begin{pmatrix} 0 \\ 1 \\ \end{pmatrix}\), \(\vec {b}=\begin{pmatrix} 0 \\ 1 \\ \end{pmatrix}\), and \(\vec {c}=\begin{pmatrix} -1 \\ 0 \\ \end{pmatrix}\). Then \(\mathcal {P}(A,\vec {b})\) is the interval [0, 1], but \(\mathcal {P}(A,\vec {b}k+\vec {c})=\emptyset \). So we cannot remove the hypothesis in Theorem 9 that none of the rows of A are 0.

Example 11

Let \(A= \begin{pmatrix} 1 &{}0 \\ -1 &{} 0\\ 0 &{} 1 \\ 0 &{} -1 \\ \end{pmatrix}\), \(\vec {b}= \begin{pmatrix} 1 \\ -1 \\ 1 \\ 0 \end{pmatrix}\), and \(\vec {c}= \begin{pmatrix} 0 \\ -1 \\ 0 \\ 0 \end{pmatrix}\). Then \(\mathcal {P}(A,\vec {b})=\{ 1\} \times [0,1]\), but \(\mathcal {P}(A,\vec {b} k+ \vec {c})=\emptyset \) for all k. So we cannot remove the hypothesis in Theorem 9 that \(\dim (\mathcal {P}(A,\vec {b})) = n\).

Write \(M_{\vec {r}, \vec {c}}\) for the number of nonnegative integer points in the transportation polytope \(\mathcal {M}(\vec {r}, \vec {c})\) and \(V_{\vec {r}, \vec {c}}\) for its relative volume.

Lemma 9

For \(1 \le i \le s\) let \(r_i,a_i \in \mathbb {Z}\), and for \(1 \le j \le t\) let \(b_j,c_j \in \mathbb {Z}\), with \(\sum r_i = \sum c_j\) and \(\sum a_i =\sum b_j\). Put \(\vec {r}_k = (r_1k + a_1, \ldots , r_sk + a_s)\) and \(\vec {c}_k = (c_1k + b_1, \ldots , c_tk + b_t)\). Then for \(k \gg 0\), the function \(k \mapsto M_{\vec {r}_k, \vec {c}_k}\) is a polynomial in k of degree equal to \((s-1)(t-1)\) and leading coefficient \(V_{\vec {r}, \vec {c}}\).

Proof

The nonnegative integer points in \(\mathcal {M}(\vec {r}_k\), \(\vec {c}_k)\) are in bijection with the nonnegative integer points in its projection \(\mathcal {M}'(\vec {r}_k, \vec {c}_k)\). By Proposition 7, we may write

$$\begin{aligned} \mathcal {M}'(\vec {r}_k, \vec {c}_k)=\mathcal {P}(A,\vec {b} k+\vec {c}), \end{aligned}$$

for an \((s+t-1) \times (s-1)(t-1)\) matrix A, and \(\vec {b},\vec {c} \in \mathbb {R}^{st}\). Moreover, A is totally unimodular with no zero rows, and \(\mathcal {P}(A,\vec {b})\) is bounded, of dimension \((s-1)(t-1)\). Hence, the result follows by Theorem 9. \(\square \)

8 Proofs of the main theorems

All of the above was aimed towards proving Theorems 1 and 3, which we complete in this section.

Recall that for integral vectors \(\vec {r}\) and \(\vec {c}\), write \(M_{\vec {r}, \vec {c}}\) for the number of nonnegative integral matrices with row margins \(\vec {r}\) and column margins \(\vec {c}\). Let us write \(V_{s,t}\) for the relative volume of the transportation polytope for row margins \((\underbrace{s, \ldots , s}_{t \text { times}})\) and column margins \((\underbrace{t, \ldots , t}_{s \text { times}})\). For instance, by Example 9, \(V_{2,3}=3\).

We recall Theorem 1 from the Introduction.

Theorem 1

Let st be relatively prime. There is a quasipolynomial \(Q_{\sigma ,\tau }(k)\) of degree \((s-1)(t-1)\) and period st, so that for integers \(k \gg 0\), we have \(N_{\sigma , \tau }(k)=Q_{\sigma ,\tau }(k)\). The leading coefficient of \(Q_{\sigma ,\tau }(k)\) is \(V_{s,t}\).

Proof

Put

$$\begin{aligned} (r_1, \ldots , r_s)=kt(1,1, \ldots ,1) \end{aligned}$$

and

$$\begin{aligned} (c_1, \ldots , c_t)=ks(1,1,\ldots ,1). \end{aligned}$$

By Theorem 6, there are integers \(a_1,\ldots , a_s\) and \(b_1, \ldots , b_t\) so that if \(\vec {r}_k~=~(r_1k~+~a_1~,\ldots , r_sk + a_s)\) and \(\vec {c}_k = (c_1k + b_1, \ldots , c_tk + b_t)\), then

$$\begin{aligned} N_{\sigma ,\tau }(i+stk)= M_{\vec {r}_k,\vec {c}_k}. \end{aligned}$$

for \(i \gg 0\). The conclusion then follows from Lemma 9. \(\square \)

Example 12

Let \(s =2, t=3\), \(\sigma = \tau = \emptyset \). Then

$$\begin{aligned} N_{\emptyset , \emptyset }(6k) = M_{\vec {r}_k, \vec {c}_k} \end{aligned}$$

where \(\vec {r}_k = (3k,3k)\) and \(\vec {c}_k = (2k,2k,2k)\). The projection \(\mathcal {M}'(\vec {r}_k,\vec {c}_k)\) is illustrated in Fig. 2.

Fig. 2
figure 2

The transportation polytope for \(i=0\)

In fact, \(N_{\emptyset , \emptyset }(6k) = 3k^2+3k+1\). For \(i =1\),

$$\begin{aligned} N_{\emptyset , \emptyset }(1+6k) = M_{\vec {r}_k, \vec {c}_k} \end{aligned}$$

where \(\vec {r}_k = (3k+1,3k)\) and \(\vec {c}_k = (2k+1,2k,2k)\). The projection \(\mathcal {M}'(\vec {r}_k, \vec {c}_k)\) is given in Fig. 3.

Fig. 3
figure 3

The transportation polytope for \(i=1\)

From this, one computes

$$\begin{aligned} N_{\emptyset , \emptyset }(n)=\left\{ \begin{array}{@{}ll@{}} 3k^2 + 3k + 1, &{} \text {if}\ n=6k \\ 3k^2 + 4k + 1, &{} \text {if}\ n=6k + 1 \\ 3k^2 + 5k + 2, &{} \text {if}\ n=6k +2 \\ 3k^2 + 6k + 3, &{} \text {if}\ n=6k +3 \\ 3k^2 + 7k + 4, &{} \text {if}\ n=6k +4 \\ 3k^2 + 8k + 5, &{} \text {if}\ n=6k +5. \end{array}\right. \end{aligned}$$

We recall Theorem 3 from the Introduction.

Theorem 3

If \({{\,\textrm{core}\,}}_d(\sigma ) = {{\,\textrm{core}\,}}_d(\tau )\), then there is a quasipolynomial \(Q_{\sigma , \tau }(k)\) of degree \(\frac{1}{d} (s-d)(t-d)\) and period m, so that for integers \(k \gg 0\), we have \(N_{\sigma , \tau }(k)=Q_{\sigma ,\tau }(k)\). The leading coefficient of \(Q_{\sigma , \tau }(k)\) is \(\left( V_{\frac{s}{d},\frac{t}{d}}\right) ^d\).

Proof

Let \(i \ge \ell _0\). We must show that for \(k \gg 0\), the map \(k \mapsto N_{\sigma ,\tau }(i+mk)\) is polynomial of the given degree and leading coefficient. By Theorem 7,

$$\begin{aligned} N_{\sigma ,\tau }(i+mk)= \prod _{j=0}^{d-1} N_{\sigma _{j}^i,\tau _{j}^i} \left( \ell _{j}^i + \frac{m}{d}k \right) , \end{aligned}$$

where each \(\sigma _j^i\) is an \(\frac{s}{d}\)-core, each \(\tau _j^i\) is a \(\frac{t}{d}\)-core, and \(\ell _j^i\) are certain nonnegative integers. Recall that \(\frac{st}{d^2}=\frac{m}{d}\). By Theorem 1, for each ij, and with \(k \gg 0\), the map \(k \mapsto N_{\sigma _{j}^i,\tau _{j}^i} \left( \ell _{j}^i + \frac{m}{d}k \right) \) is a polynomial of degree

$$\begin{aligned} \left( \frac{s}{d}-1 \right) \left( \frac{t}{d}-1 \right) , \end{aligned}$$

and leading coefficient \(V_{\frac{s}{d},\frac{t}{d}}\). The theorem follows. \(\square \)

Example 13

From Example 8, we have for \(\sigma = (3,1,1), \tau = (3,2)\),

$$\begin{aligned} N_{\sigma , \tau }(12 + 12k) = N_{(1),(1,1)}(7+6k) \cdot N_{(1),\emptyset }(5+6k). \end{aligned}$$

Following the proof of Theorem 9 gives

$$\begin{aligned} N_{(1),(1,1)}(7+6k)= 3k^2 +10k+7 \end{aligned}$$

and

$$\begin{aligned} N_{(1),\emptyset }(5+6k) = 3k^2 +8k+5. \end{aligned}$$

Thus,

$$\begin{aligned} N_{\sigma , \tau }(12 + 12k) = (3k^2 +10k+7 )(3k^2 +8k+5). \end{aligned}$$

Finally, we consider the number of \(\lambda \) with length exactly k, and having s-core \(\sigma \) and t-core \(\tau \). This is given by

$$\begin{aligned} N'_{\sigma , \tau }(k) = N_{\sigma , \tau }(k)- N_{\sigma , \tau }(k-1). \end{aligned}$$

From Theorem 3 we deduce:

Corollary 2

There is a quasipolynomial \(Q'_{\sigma , \tau }(k)\) of degree less than \(\frac{1}{d} ~(s-~d)(t-d)\) and period m, so that for integers \(k \gg 0\), we have \(N'_{\sigma ,\tau }(k)=Q'_{\sigma ,\tau }(k)\).