\section{Introduction}
\label{sec:MEP}

Exchange processes underlie numerous phenomena. In natural sciences, exchange plays an important role in droplet growth via evaporation and re-condensation \cite{meakin}, island growth in deposition processes \cite{az}, and phase ordering \cite{ls,ajb,sm}. Exchange processes have been also applied to modeling segregation of heterogeneous populations \cite{ts}, studying the distribution of wealth \cite{IKR98}, mimicking growth of urban populations \cite{lr} and aggregation behaviors in job markets \cite{Sun14}.

The basic ingredient of exchange processes are clusters. We suppose that clusters are composed of a certain integer number of elemental building blocks (`monomers'); clusters are thus labelled by their masses, other characteristics (e.g., their shape) are not explicitly taken into account. We also assume that in each exchange event, a monomer is transferred from one cluster to another.  An exchange event can be separated into detachment of a monomer, subsequent transport to another cluster and attachment to it, so the comprehensive description of exchange processes can be complicated. We focus on the detachment-controlled limit when the time scale for transport and subsequent attachment is negligible.

Denote by $A_j$ a cluster of mass $j$, that is, a cluster which is made of $j$ monomers. Symbolically, the mass exchange process can be represented as
\begin{equation*}
A_i+A_j\mathop{\longrightarrow}^{K_{i,j}}A_{i\pm 1}+A_{j\mp 1}
\end{equation*}
We assume that a cluster is equally likely to gain or to lose mass in an interaction. This implies that the reaction rate matrix (`kernel' in short) is symmetric: $K_{i,j}=K_{j,i}$. A cluster disappears when its mass reaches zero. Thus the number of clusters decreases by 1 with probability 1/2 when strictly one of the reacting clusters is a monomer; if both reacting clusters are monomers, one of the monomers disappears and the other becomes a dimer. Exchange processes with rather general classes of homogeneous symmetric kernels, e.g., with kernels of the form $K_{i,j}=i^aj^b+i^bj^a$, have been studied in Refs.~\cite{KL02,EP03}.

The density $c_m(t)$ of clusters containing $m$ monomers at time $t$ evolves according to the rate equation
\begin{equation}
\label{exchange:RE}
\frac{dc_m}{dt} = \sum_{i,j} c_i c_j K_{i,j} \left[\delta_{m,i+1}+\delta_{m,i-1}-2\delta_{m,i}\right]
\end{equation}
This equation assumes perfect mixing, or equivalently, absence of spatial correlations. Furthermore, the total number of clusters is assumed to be infinite; otherwise, even if we ignore the locations of clusters, the system will eventually condense into a single cluster and close to the condensation time fluctuations in number of clusters become important, so the deterministic rate equation framework looses its validity. Even for infinite systems in homogeneous settings, the rate equation framework becomes inapplicable in low dimensions, particularly in one dimension (see \cite{ARS08,Evans14} and references therein).

If the reaction kernel is the product of reactant masses, $K_{i,j}=ij$, the cluster densities $c_m(t)$ satisfy
\begin{equation}
\label{exchange:prod}
\frac{dc_m}{d t}=M[(m+1)c_{m+1}-2mc_m+(m-1)c_{m-1}]
\end{equation}
and since the mass density $M=\sum_{j\geq 1} j c_j$  remains constant due to mass conservation, Eqs.~\eqref{exchange:prod} are linear. The linearity of rate equations distinguishes the product kernel from other kernels. If the system is initially composed of monomers, $c_m(t=0) = \delta_{m,1}$, the solution  reads
\begin{equation}
\label{prod:exact}
c_m(t) = \frac{t^{m-1}}{(1+t)^{m+1}}
\end{equation}
The corresponding total cluster density is
\begin{equation}
\label{Nt:def}
N=\sum_{j\geq 1} c_j  = (1+t)^{-1}
\end{equation}
The cluster distribution \eqref{prod:exact} is the simplest exact result in the context of exchange processes \cite{IKR98,EP03}; it was originally discovered in earlier studies of birth-death processes (see \cite{Kendall49} and references therein). A few other exact solutions for exchange processes with more complicated kernels can be found in \cite{IKR98,EP03,book,FL03}.

Exchange processes help in classifying and interpreting emergent phenomena in various complex systems \cite{meakin,az,ls,ajb,sm,ts,IKR98,lr,Sun14}. Pure exchange process may provide an idealized description of binary interactions underlying the dynamics of such complex systems.  In addition, complex systems are usually open and driven. Perhaps the most ubiquitous example of an external drive is input; e.g., it is a key element in deposition processes and it naturally arises in phase ordering. The goal of this paper is to study the interplay between exchange and input.

Pure exchange processes resemble aggregation processes \cite{similarity}. In the framework of aggregation, the influence of input has been studied. The outcome was somewhat surprising: For basic reaction kernels, aggregation processes with homogeneous input are {\em simpler} than corresponding pure aggregation processes, viz. in the most interesting large time limit the dominant part of the cluster mass distribution acquires a stationary form (see e.g. \cite{book,FL03,HH87,HT89,CRZ,Colm12}). There are exceptional kernels and whenever the stationary form is never reached, the emergent behaviors tend to be subtle (often they are characterized by more than one mass scale \cite{JM98,Colm12}). We shall show that in contrast to aggregation, exchange processes with spatially homogeneous input do not reach steady states. The emergent evolutionary behaviors, however, are usually qualitatively the same as for exchange processes without input \cite{EP03}.

Our second goal is to study exchange processes with a localized source. A classification of possible behaviors in such processes appears unattainable---the behaviors depend on the reaction kernel, on the (mass-dependent) diffusion coefficients, and mathematically one has to study an infinite system of coupled non-linear partial differential equations. In the idealized situation when the diffusion coefficients are mass-independent, however, the models with a localized source are partly tractable. More precisely, the cluster mass distribution becomes stationary, at least in the most relevant three-dimensional setting, and this feature greatly simplifies analysis.

Our analysis of mass exchange processes with input relies on scaling techniques. The emergence of scaling is difficult to prove, so it is useful to have exact results at least for simplest kernels which can be compared with outcomes of scaling analyses. It turned out that the model with product kernel remains solvable when we add homogeneous input. A few basic densities are still given by neat formulas, especially in the most natural setting when (i) only monomers are injected, and (ii) the system is initially empty. We will show that in this situation the total density reads
\begin{equation}
\label{prod:total-input}
N  = \frac{1}{\sqrt{t^2+2}}\,\ln\frac{\sqrt{t^2+2} + t}{\sqrt{t^2+2} - t}
\end{equation}
while the density of monomers is
\begin{equation}
\label{prod:monomer-input}
c_1  = \frac{t}{t^2+2} +  \frac{1}{(t^2+2)^{3/2}}\,\ln\frac{\sqrt{t^2+2} + t}{\sqrt{t^2+2} - t}
\end{equation}

The remainder of this paper is organized as follows. In Sec.~\ref{sec:exact} we derive \eqref{prod:total-input}--\eqref{prod:monomer-input} and other exact results for the exchange process with product kernel and homogeneous input of monomers. This is a unique kernel for which an exact approach (based on the generating function technique) has been successful so far; another exactly soluble kernel (Sec.~\ref{sec:mon-dimer}) is degenerate as it only couples monomers and dimers. We are mostly interested in long time behaviors, however. Such behaviors can be explored using scaling techniques \cite{EP03,book,FL03}. Additionally, scaling techniques are applicable not just to the solvable product kernel, but to numerous kernels, even families of kernels. In Sec.~\ref{sec:scaling} we illustrate scaling techniques for exchange processes with three basic kernels: (i) product kernel $K_{i,j}=ij$,  (ii) constant kernel $K_{i,j}=1$, and (iii) sum kernel $K_{i,j}=i+j$. In Sec.~\ref{sec:GPK} we analyze exchange processes with a one-parameter family of kernels, namely the generalized product kernels $K_{i,j}=(ij)^{\lambda}$. We show that scaling methods are applicable to the generalized product kernels with homogeneity index $\lambda<\frac{3}{2}$. In the $\frac{3}{2}<\lambda\leq 2$, an infinite cluster (`gel') is formed at a finite time, while for $\lambda>2$ there is instantaneous gelation. In Sec.~\ref{sec:GPK} we also briefly discuss the extreme values of the homogeneity index: $\lambda=-\infty$ which is exactly soluble and $\lambda=2$ showing a multi-scaling behavior. In Sec.~\ref{sec:local} we study exchange processes driven by a localized source. We show that when the diffusion coefficients are mass-independent, the densities attain a steady state, at least in the most relevant three-dimensional setting, and we determine these densities for a few basic kernels. We also probe models with diffusion coefficients decaying as $(\text{mass})^{-1}$ and show that a stationary scaling mass distribution emerges when $\lambda<\frac{1}{2}$. We close (Sec.~\ref{sec:conl}) with a short discussion.

\section{Exact Analysis}
\label{sec:exact}

Here we investigate the mass exchange process with product kernel and homogenous input using exact techniques. We shall assume that only monomers are injected. This is the most natural choice: The same elemental mass which is transferred in each exchange event is also added. The details of the input, however, do not affect qualitative behaviors (as long as clusters of only small masses are added). We shall also assume that the system is initially empty,
\begin{equation}
\label{IC}
c_m(t=0)=0,
\end{equation}
so that the mass density is equal to time,
\begin{equation}
\label{mass}
\sum_{j\geq 1} j c_j(t) = t,
\end{equation}
if only monomers are injected and if the monomer flux is set to unity.

In the case of the product kernel, $K_{i,j}=ij$, we thus arrive at the infinite set of rate equations
\begin{equation}
\label{prod:input}
\frac{dc_m}{d t} =  \delta_{m,1} + t[(m+1)c_{m+1}-2mc_m+(m-1)c_{m-1}]
\end{equation}

Equations \eqref{prod:input} are linear. In this respect, they are similar to Eqs.~\eqref{exchange:prod} describing the evolution without input. In contrast to Eqs.~\eqref{exchange:prod}, however, we now have an inhomogeneous system of equations with time-dependent coefficients. It is still possible to solve \eqref{prod:input} subject to the initial condition \eqref{IC}. Multiplying \eqref{prod:input} by $z^m$ and summing over all $m\geq 1$ we reduce an infinite set of rate equations \eqref{prod:input} to a single partial-differential equation
\begin{equation}
\label{prod:GF}
\left[\frac{1}{t}\,\frac{\partial}{\partial t}-(1-z)^2\,\frac{\partial}{\partial z}\right]\mathcal{C} = \frac{z}{t}-c_1(t)
\end{equation}
for the generating function
\begin{equation}
\label{GF:def}
\mathcal{C}(z,t) = \sum_{m\geq 1} z^m c_m(t)
\end{equation}
Transforming variables $(z,t)$ to variables
\begin{equation}
\xi = \frac{t^2}{2} - \frac{1}{1-z}\,, \quad \eta =  \frac{t^2}{2} + \frac{1}{1-z}
\end{equation}
we recast \eqref{prod:GF} into
\begin{equation}
\label{prod:GF1}
2\,\frac{\partial \mathcal{C}}{\partial \xi} = \frac{1-\frac{2}{\eta - \xi}}{\sqrt{\xi + \eta}}-c_1\!\left(\!\sqrt{\xi + \eta}\right)
\end{equation}
Integrating \eqref{prod:GF1} yields
\begin{eqnarray}
\label{prod:GF-sol}
\mathcal{C}(\xi,\eta) &=& \int_{-\eta}^\xi \frac{du}{\sqrt{u+ \eta}}\,\left[\frac{1}{2} -\frac{1}{\eta - u}\right] \nonumber\\
 &-& \frac{1}{2}\int_{-\eta}^\xi du\,c_1\!\left(\!\sqrt{\xi + \eta}\right)
\end{eqnarray}
The choice of the lower integration limit in \eqref{prod:GF-sol} ensures $\mathcal{C}|_{\xi = -\eta} = 0$, which is equivalent to $\mathcal{C}(z,t=0) = 0$, i.e., to our choice of the initial condition, Eq.~\eqref{IC}.

Computing the first integral in\eqref{prod:GF-sol} and returning to the original $(z,t)$ variables we obtain
\begin{eqnarray}
\label{prod:GF-final}
\mathcal{C}(z,t) &=& t - \int_0^t dv\,v c_1(v) \nonumber\\
 &-& \frac{1}{\sqrt{t^2+2\zeta}}\,\ln\frac{\sqrt{t^2+2\zeta} + t}{\sqrt{t^2+2\zeta} - t}
\end{eqnarray}
where $\zeta=(1-z)^{-1}$.

According to the definition \eqref{GF:def}, the generating function must vanish for $z=0$. Therefore
\begin{equation}
\label{prod:mon}
\int_0^t dv\,v c_1(v) = t-\frac{1}{\sqrt{t^2+2}}\,\ln\frac{\sqrt{t^2+2} + t}{\sqrt{t^2+2} - t}
\end{equation}
leading to the announced expression \eqref{prod:monomer-input} for the monomer density (see also Fig.~\ref{Fig:c1N}).

\begin{figure}
\centering
\includegraphics[width=8cm]{c1N}
\caption{Evolution of the total density $N(t)$ and the monomer density $c_1(t)$ in the mass exchange process with product kernel and homogeneous input. The top curve shows the total density  given by Eq.~\eqref{prod:total-input}; the bottom curve shows the monomer density given by Eq.~\eqref{prod:monomer-input}.}
\label{Fig:c1N}
\end{figure}

Using \eqref{prod:mon} we can re-write \eqref{prod:GF-final} as
\begin{eqnarray}
\label{prod:GF-final2}
\mathcal{C}(z,t) &=&  \frac{1}{\sqrt{t^2+2}}\,\ln\frac{\sqrt{t^2+2} + t}{\sqrt{t^2+2} - t} \nonumber\\
 &-& \frac{1}{\sqrt{t^2+2\zeta}}\,\ln\frac{\sqrt{t^2+2\zeta} + t}{\sqrt{t^2+2\zeta} - t}
\end{eqnarray}
Since $\mathcal{C}(z=1,t)=N(t)$  we obtain the total cluster density by specializing \eqref{prod:GF-final} to $z=1$. This gives \eqref{prod:total-input} shown on Fig.~\ref{Fig:c1N}.

The generating function \eqref{prod:GF-final2} encapsulates all cluster densities. Expanding $\mathcal{C}(z,t)$ in power series in $z$ one can extract explicit expressions for cluster densities.  General expressions for cluster densities are similar to \eqref{prod:monomer-input}, viz.
\begin{equation}
\label{prod:cm-input}
c_m  = \frac{tP_m(t)}{(t^2+2)^m} +  \frac{Q_m(t)}{(t^2+2)^{m+1/2}}\,\ln\frac{\sqrt{t^2+2} + t}{\sqrt{t^2+2} - t}
\end{equation}
where $P_m(t)$ and $Q_m(t)$ are even polynomials of degree $2(m-1)$. For instance,
\begin{equation*}
\begin{split}
& P_2 = \tfrac{1}{2}t^2 - \tfrac{1}{2}, \qquad \qquad \qquad \quad Q_2 = t^2 + \tfrac{1}{2}\\
& P_3 = \tfrac{1}{3}t^4 -  \tfrac{5}{6}t^2 - \tfrac{1}{2}, \qquad \qquad ~Q_3 = t^4 + t^2 + \tfrac{1}{2}\\
& P_4 = \tfrac{1}{4}t^6 - \tfrac{13}{12}t^4 -  \tfrac{31}{24}t^2 - \tfrac{5}{8}, \quad Q_4 = t^6+ \tfrac{3}{2}t^4 + \tfrac{3}{2}t^2 + \tfrac{5}{8}
\end{split}
\end{equation*}

\section{Scaling Analysis of Three Basic Kernels}
\label{sec:scaling}

In this section we employ scaling techniques. We start with the product kernel for which one can justify scaling using an exact solution from Sec.~\ref{sec:exact}. We then turn to two other simplest kernels, the constant kernel and the sum kernel, for which scaling appears to be the only available analytical technique.

\subsection{Product Kernel}

Here we re-consider the product kernel, $K_{i,j}=ij$, but use scaling instead of exact methods. The typical mass is expected to grow indefinitely. For large masses, we can treat $m$ as a continuous variable and approximate the system of rate equations \eqref{prod:input} by the partial differential equation for the density $c=c_m(t)$:
\begin{equation}
\label{prod:cmt}
\frac{\partial c}{\partial t} = t\,\frac{\partial^2 (mc)}{\partial m^2}
\end{equation}
Balancing both sides of this equation yields $\frac{1}{t}\sim \frac{t}{m}$, so the typical mass grows according to $m\sim t^2$.

To establish the asymptotic behavior of the density of monomers we sum all Eqs.~\eqref{prod:input} and obtain the exact rate equation for the total cluster density:
\begin{equation}
\label{prod:total}
\frac{dN}{d t} =  1 - tc_1
\end{equation}
This equation suggests that
\begin{equation}
\label{prod:c1}
\lim_{t\to\infty} tc_1 = 1
\end{equation}
The rate equation for the density of monomers
\begin{equation}
\label{prod:c1t}
\frac{dc_1}{d t} =  1- 2t[c_1-c_2]
\end{equation}
suggests that $\lim_{t\to\infty} t(c_1-c_2) = 1/2$, which in conjunction with \eqref{prod:c1} give
\begin{equation}
\label{prod:c2}
\lim_{t\to\infty} tc_2 = \frac{1}{2}
\end{equation}
Similarly analyzing the rate equation for the density of dimers we get $\lim_{t\to\infty} tc_3 = \frac{1}{3}$, and generally for any {\em fixed} mass $k$ we have
\begin{equation}
\label{prod:ck}
\lim_{t\to\infty} tc_k = \frac{1}{k}
\end{equation}

Using \eqref{prod:ck} together with the growth law, $\langle m\rangle \sim t^2$, of the average mass we arrive at the following scaling form of the cluster distribution:
\begin{equation}
\label{cmt:scaling}
c_m(t) = \frac{1}{tm}\, F(\mu), \qquad \mu = \frac{m}{t^2}
\end{equation}
More precisely, the scaling form \eqref{cmt:scaling} is expected to hold in the scaling limit
\begin{equation}
\label{prod:scaling}
t\to\infty, \quad  m\to\infty, \quad \mu = \frac{m}{t^2} =\text{fixed}
\end{equation}
The small mass behavior \eqref{prod:ck} and the mass conservation law \eqref{mass} imply the following properties of the scaled mass distribution:
\begin{subequations}
\begin{align}
\label{FM:0}
F(0) &= 1\\
\label{FM:Int}
\int_0^\infty d\mu\,F(\mu) &= 1
\end{align}
\end{subequations}
The scaling form \eqref{cmt:scaling} together with \eqref{FM:0} lead to a rather unusual asymptotic behavior of the total cluster density:
\begin{equation}
\label{prod:N_asymp}
N\simeq \frac{2}{t}\,\ln t
\end{equation}

\begin{figure}
\centering
\includegraphics[width=8cm]{FM-prod}
\caption{The scaled mass distribution $F(\mu)$ given by Eq.~\eqref{F:sol_B} arising in the mass exchange process with product kernel and homogeneous input.}
\label{Fig:FM-prod}
\end{figure}

To determine the scaled mass distribution we plug the scaling form \eqref{cmt:scaling} into the governing partial differential equation \eqref{prod:cmt} and find that the scaled mass distribution satisfies an ordinary differential equation
\begin{equation}
\label{FM:eq}
F''+2F'+\frac{1}{\mu}\,F = 0
\end{equation}
where the differentiation with respect to $\mu$ is denoted by prime. Seeking solution in the form $F(\mu)=e^{-\mu} \Phi(\mu)$ we eliminate the term with first derivative:
\begin{equation}
\label{Phi:eq}
\Phi''+\left(\frac{1}{\mu}-1\right)\Phi = 0
\end{equation}
WKB theory shows that there are two possible large $\mu$ asymptotic behaviors, $\mu^{-1/2}e^\mu$ and $\mu^{1/2}e^{-\mu}$. Only the latter asymptotic is acceptable. The boundary condition $F(0)=1$, equivalently $\Phi(0)=1$, then leads to the unique solution,  $\Phi=\mu[K_0(\mu)+K_1(\mu)]$, in terms of the modified Bessel functions $K_0$ and $K_1$. Thus
\begin{equation}
\label{F:sol_B}
F(\mu)=\mu\,e^{-\mu}\left[K_0(\mu)+K_1(\mu)\right]
\end{equation}
(see also Fig.~\ref{Fig:FM-prod}). Recalling that $K_1=-K_0'$, we can re-write \eqref{F:sol_B} as
\begin{equation}
\label{F:sol}
F= - \mu\,\frac{d}{d\mu}\left[e^{-\mu}K_0(\mu)\right]
\end{equation}
Plugging \eqref{F:sol} into \eqref{FM:Int} and performing the integration by parts we see that the validity of \eqref{FM:Int}  is equivalent to
\begin{equation}
\label{K10}
\int_0^\infty d\mu\,e^{-\mu}K_0(\mu)=1
\end{equation}
This identity can be derived e.g. from the integral representation of the modified Bessel function $K_0$:
\begin{equation}
\label{K0}
K_0(\mu) = \int_1^\infty \frac{du}{\sqrt{u^2-1}}\,e^{-\mu\,u}
\end{equation}

We also mention asymptotic behaviors of the scaled mass distribution. In the small mass limit ($\mu\to 0$)
\begin{equation}
\label{FM:small}
F(\mu) -1 \simeq \mu\left(\ln\frac{2}{\mu}-1-\gamma\right)
\end{equation}
and in the large mass limit ($\mu\to\infty$)
\begin{equation}
\label{FM:large}
F(\mu) \simeq \sqrt{2\pi\mu}\,e^{-2\mu}
\end{equation}

For the product kernel we can use exact results to verify scaling predictions. The exact prediction \eqref{prod:monomer-input} for the monomer density gives
\begin{equation}
\label{prod:c1_asymp}
c_1 = \frac{1}{t} + \frac{1}{t^3}\,[2\ln t -2+ \ln 2] +\ldots
\end{equation}
when $t\gg 1$, so the scaling prediction \eqref{prod:c1} agrees with the exact prediction in the leading order. Similarly, the exact prediction \eqref{prod:total-input} or the total density,
\begin{equation}
\label{prod:N_asymptotic}
N\simeq \frac{1}{t}\,[2\ln  t + \ln 2] +  \frac{1}{t^3}\,[-\ln t + 1-\ln 2] +\ldots
\end{equation}
for $t\gg 1$, has the leading order term which agrees with the scaling prediction \eqref{prod:N_asymp}.

To confirm the emergence of the mass scaling \eqref{prod:scaling} and deduce the scaled mass distribution it is convenient to re-write the exact prediction  \eqref{prod:GF-final2} for the generating function in the form
\begin{equation}
\label{GF_exact}
\sum_{m\geq 1} (1-z^m)c_m(t)= \frac{1}{\sqrt{t^2+2\zeta}}\,\ln\frac{\sqrt{t^2+2\zeta} + t}{\sqrt{t^2+2\zeta} - t}
\end{equation}
The scaling regime emerges when $\zeta \sim t^2$. Recalling that $\zeta=(1-z)^{-1}$, we write
\begin{equation}
\label{zs}
z = 1 - \frac{s}{t^2}
\end{equation}
and take the $t\to\infty$ limit while keeping $s$ finite. Combining \eqref{GF_exact} and \eqref{zs} we see the consistency of \eqref{cmt:scaling}--\eqref{prod:scaling}. Furthermore, plugging \eqref{zs} and \eqref{cmt:scaling} into \eqref{GF_exact} we obtain an integral equation
\begin{equation}
\label{prod:IE}
\int_0^\infty \frac{d\mu}{\mu}\,(1-e^{-\mu s})F(\mu) = \sqrt{\frac{s}{s+2}}\,\ln\frac{\sqrt{s+2}+\sqrt{s}}{\sqrt{s+2}-\sqrt{s}}
\end{equation}
for the scaled mass distribution.  One can verify that the scaled mass distribution which we established using scaling methods is indeed the solution of the integral equation \eqref{prod:IE}.

\subsection{Constant Kernel}
\label{sec:constant}

For the constant kernel $K_{i,j}=1$, the rate equations read
\begin{equation}
\label{const:input}
\frac{dc_m}{d t} =  \delta_{m,1} + N[c_{m+1}-2c_m+c_{m-1}]
\end{equation}
Summing \eqref{const:input} we obtain
\begin{equation}
\label{const:total}
\frac{dN}{d t} =  1 - Nc_1
\end{equation}

For large $t$ and $m$ we can approximate the system of rate equations \eqref{const:input} by the partial differential equation which happens to be the diffusion equation
\begin{equation}
\label{const:cmt}
\frac{\partial c}{\partial \tau} = \frac{\partial^2 c}{\partial m^2}
\end{equation}
where we have use an auxiliary time variable:
\begin{equation}
\label{def:tau}
\tau = \int_0^t dt'\,N(t')
\end{equation}

The appropriate scaling form for the cluster mass distribution is
\begin{equation}
\label{cmt:scal}
c_m(\tau) = \tau^{-1/4}\, F(\mu), \qquad \mu = \frac{m}{\sqrt{\tau}}
\end{equation}
The form of the scaled mass, $\mu=m/\sqrt{\tau}$, is obvious from \eqref{const:cmt}. The time-dependent pre-factor in \eqref{cmt:scal} was chosen to ensure the validity of the asymptotic, $Nc_1\to 1$ when $\tau\to\infty$, which is implied by Eq.~\eqref{const:total}. Indeed, using \eqref{cmt:scal} we find that the cluster density $N(\tau)=\sum_{m\geq 1}c_m(\tau)$ grows according to
\begin{equation}
N = \tau^{1/4}\int_0^\infty d\mu\, F(\mu)
\end{equation}
Therefore $Nc_1$ is asymptotically constant and it equals to unity if
\begin{equation}
\label{FF}
F(0)\int_0^\infty d\mu\, F(\mu) = 1
\end{equation}
Hence $N = [F(0)]^{-1}\tau^{1/4}$. Plugging this into \eqref{def:tau} we get
\begin{equation}
\label{t:tau}
t = \frac{4F(0)}{3}\,\tau^{3/4}
\end{equation}

Using \eqref{cmt:scal} we compute the mass density
\begin{equation}
\label{const:mass}
\sum_{j\geq 1} j c_j(t) = \tau^{3/4}\int_0^\infty d\mu\, \mu F(\mu) = t
\end{equation}
Comparing \eqref{t:tau} and \eqref{const:mass} we obtain
\begin{equation}
\label{FFF}
\frac{4F(0)}{3} = \int_0^\infty d\mu\, \mu F(\mu)
\end{equation}

To complete the analysis we must find the scaled mass distribution $F(\mu)$. Plugging \eqref{cmt:scal} into \eqref{const:cmt} leads to an ordinary differential equation
\begin{equation}
\label{FM2}
F''+\tfrac{1}{2}\mu F'+\tfrac{1}{4}\,F = 0
\end{equation}
Demanding that $F(\mu)$ decays sufficiently rapidly we arrive at a one-parameter family of solutions
\begin{equation}
\label{FM:1d}
F = C\,\sqrt{\mu}\,\exp(-\mu^2/8)\, K_{1/4}(\mu^2/8)
\end{equation}
involving the modified Bessel function $K_{1/4}$.

To fix the amplitude $C$ we use relations \eqref{FF} and \eqref{FFF}. In computations, an integral representation of the modified Bessel function $K_{1/4}$ proves useful. This integral representation is obtained by specializing
\begin{equation*}
K_\nu(z) = \frac{\sqrt{\pi}}{\Gamma\big(\nu+\frac{1}{2}\big)}\left(\frac{z}{2}\right)^\nu \int_1^\infty \frac{du}{\sqrt{u^2-1}}\,(u^2-1)^\nu \, e^{-z\,u}
\end{equation*}
to $\nu=1/4$. Using above integral representation one can compute the two-parameter family of integrals,
\begin{equation}
\label{Kbn:def}
K(\beta,\nu):=\int_0^\infty dz\,z^{\beta-1}\,e^{-z}\,K_\nu(z),
\end{equation}
with arbitrary $\beta, \nu$ satisfying $\beta>\nu$. One finds
\begin{eqnarray}
\label{Kbn}
K(\beta,\nu) &=& \frac{\sqrt{\pi}\,\Gamma(\beta+\nu)}{2^\nu\,\Gamma\big(\nu+\frac{1}{2}\big)}
\int_1^\infty du\,\frac{(u-1)^{\nu-\frac{1}{2}}}{(u+1)^{\beta+\frac{1}{2}}}\nonumber\\
&=& \frac{\sqrt{\pi}\,\Gamma(\beta+\nu)\,\Gamma(\beta-\nu)}{2^\beta\,\Gamma\big(\beta+\frac{1}{2}\big)}
\end{eqnarray}
As a check we note that $K(1,0)$ reduces to the integral in \eqref{K10} and the right-hand side of \eqref{Kbn} is equal to unity for $(\beta,\nu) = (1,0)$.

Using \eqref{FM:1d} and writing $\mu=\sqrt{8z}$ we express the integrals appearing in \eqref{FF} and \eqref{FFF} through the integrals $K(\beta,\nu)$, namely
\begin{equation}
\label{FK}
\begin{split}
\int_0^\infty d\mu\, F(\mu) &= C\cdot 2^{5/4} K\big(\tfrac{3}{4}, \tfrac{1}{4}\big)\\
\int_0^\infty d\mu\, \mu F(\mu) &= C\cdot 2^{11/4} K\big(\tfrac{5}{4}, \tfrac{1}{4}\big)
\end{split}
\end{equation}
Combining \eqref{FK} with \eqref{Kbn} and adding $F(0)$ we get
\begin{subequations}
\begin{align}
\label{F0}
F(0) &= C\,\frac{\pi\sqrt{2}}{\Gamma\big(\frac{3}{4}\big)}\\
\label{F1}
\int_0^\infty d\mu\, F(\mu) &= C\,\frac{\pi\sqrt{2}}{\Gamma\big(\frac{5}{4}\big)}\\
\label{F2}
\int_0^\infty d\mu\, \mu F(\mu) &= C\,\frac{\pi\sqrt{2}}{\Gamma\big(\frac{3}{4}\big)}\times \frac{4}{3}
\end{align}
\end{subequations}
Equations \eqref{F0} and \eqref{F2} show that \eqref{FFF} is manifestly satisfied. Using \eqref{F0} and \eqref{F1} we see that to ensure the validity of \eqref{FF} we must choose
\begin{equation}
\label{C:1d}
C= \frac{1}{2^{5/4}\,\sqrt{\pi}}= 0.237212499\ldots
\end{equation}

The asymptotic behaviors of the scaled mass distribution are
\begin{equation}
\label{small}
F(\mu)\simeq F(0)=\frac{\sqrt{\pi}}{2^{3/4}\,\Gamma\big(\frac{3}{4}\big)}=0.860039988\ldots
\end{equation}
when $\mu\to 0$ and
\begin{equation}
\label{large}
F(\mu) \simeq \frac{1}{2^{1/4}\sqrt{\mu}}\,e^{-\mu^2/4}
\end{equation}
when $\mu\to\infty$. The latter formula implies that
\begin{equation}
c_m(\tau)\simeq \frac{1}{2^{1/4}\sqrt{m}}\,\exp\!\left[-\frac{m^2}{4\tau}\right]
\end{equation}
for $m\gg \sqrt{\tau}$.

Finally, we give asymptotic formulas for the total density and the monomer density through the original time variable:
\begin{equation}
\label{sum:1/3}
N=At^{1/3}, \qquad c_1=A^{-1}t^{-1/3}
\end{equation}
where the amplitude is given by
\begin{equation*}
A=\frac{6^{1/3} \left[\Gamma\big(\frac{3}{4}\big)\right]^{4/3}}{\pi^{2/3}} = 1.1108674179\ldots
\end{equation*}

\subsection{Sum Kernel}

For the sum kernel $K_{i,j}=i+j$, the rate equations read
\begin{eqnarray}
\label{prod:sum}
\frac{dc_m}{d t} &=& N[(m+1)c_{m+1}-2mc_m+(m-1)c_{m-1}]\nonumber\\
&+& t[c_{m+1}-2c_m+c_{m-1}] +  \delta_{m,1}
\end{eqnarray}

The total cluster density satisfies
\begin{equation}
\frac{d N}{d t} = 1-tc_1
\end{equation}
leading to the same asymptotic relation \eqref{prod:c1} for the monomer density as in the case of the product kernel.

In the scaling regime, the cluster density $c=c_m(t)$ obeys the partial differential equation
\begin{equation}
\label{sum:cmt}
\frac{\partial c}{\partial t} = N\,\frac{\partial^2 (mc)}{\partial m^2} + t\,\frac{\partial^2 c}{\partial m^2}
\end{equation}
Balancing the left-hand side with the first term on the right-hand side gives $m\sim Nt$, while balancing with the second term leads to $m\sim t$. These estimates for the typical mass are comparable, and thence both terms on the right-hand side remain asymptotically relevant, if $N$ saturates at a certain finite value $N_\infty$. Below we compute this value and find
\begin{equation}
\label{N:sum_kernel}
\lim_{t\to\infty} N(t) = N_\infty = 1
\end{equation}
but now we merely suppose that the cluster density reaches a finite value $N_\infty$. Since $m\sim t$, the cluster mass distribution is sought in the scaling form
\begin{equation}
\label{sum:scaling}
c_m(t) = \frac{1}{t}\, F(\mu), \qquad \mu = \frac{m}{t}
\end{equation}
Combining \eqref{sum:cmt} and \eqref{sum:scaling} we arrive at
\begin{equation*}
F+\mu F' +[F+N_\infty \mu F]'' = 0
\end{equation*}
Integrating once we obtain $\mu F +[F+N_\infty \mu F]' = 0$, or equivalently
\begin{equation*}
[1+N_\infty \mu] F' +[N_\infty + \mu] F= 0
\end{equation*}
Integrating this equation gives a family of solutions
\begin{equation}
\label{FNC}
F = \frac{C}{(1+N_\infty \mu)^{1-1/N_\infty^2}}\,e^{-\mu/N_\infty}
\end{equation}
with two un-determined constants: $C$ and $N_\infty$.

We should impose three conditions on the scaled mass distribution:
\begin{subequations}
\begin{align}
\label{F0:sum}
F(0) &= 1\\
\label{F1:sum}
\int_0^\infty d\mu\, F(\mu) &= N_\infty\\
\label{F2:sum}
\int_0^\infty d\mu\, \mu F(\mu) &= 1
\end{align}
\end{subequations}
Equation \eqref{F0:sum} ensures the validity of \eqref{prod:c1}; Eq.~\eqref{F1:sum} follows from $\lim_{t\to\infty} \sum_{m\geq 1}c_m(t) = N_\infty$; the last condition, Eq.~\eqref{F2:sum}, is the conservation law $\sum_{m\geq 1}c_m(t) = t$. Equation \eqref{F0:sum} obviously leads to $C=1$. Further, one can verify that the only choice of $N_\infty$ which agrees with Eqs.~\eqref{F1:sum}--\eqref{F2:sum} is $N_\infty=1$ as it was stated in \eqref{N:sum_kernel}. Thus \eqref{FNC} simplifies to
\begin{equation}
\label{F:sum}
F = e^{-\mu}
\end{equation}

\section{Generalized Product Kernels}
\label{sec:GPK}

In this section we consider exchange processes with generalized product kernels, $K_{i,j}=(ij)^\lambda$, and homogeneous input of monomers. The rate equations read
\begin{equation}
\label{GP:input}
\frac{dc_m}{d t} =  M_\lambda [(m+1)^\lambda c_{m+1} -2m^\lambda c_m +(m-1)^\lambda c_{m-1}]
\end{equation}
for $m>1$, while the monomer density satisfies
\begin{equation}
\label{GP:monomer}
\frac{dc_1}{d t} = 1 +  M_\lambda [2^\lambda c_2 -2 c_1]
\end{equation}
Here $M_\lambda$ is the $\lambda^\text{th}$ moment of the cluster mass distribution:
\begin{equation}
\label{GP:moment}
M_\lambda(t) = \sum_{m\geq 1} m^\lambda c_m(t)
\end{equation}
Note that the cluster density is the zeroth moment and the mass density is first moment of the cluster mass distribution: $N=M_0$ and $M=M_1$.

For large $t$ and $m$ we replace the system of rate equations \eqref{GP:input} by the partial differential equation \begin{equation}
\label{GP:cmt}
\frac{\partial c}{\partial \tau} = \frac{\partial^2 (m^\lambda c)}{\partial m^2}
\end{equation}
where $\tau$ is an auxiliary time variable
\begin{equation}
\label{GP:tau}
\tau = \int_0^t dt'\,M_\lambda(t')
\end{equation}

We seek the cluster mass distribution in the scaling form
\begin{equation}
\label{GP:scal}
c_m(\tau) = \tau^{-b}\, F(\mu), \qquad \mu = \frac{m}{\tau^a}
\end{equation}
The form of the governing equation \eqref{GP:cmt} fixes the exponent $a$ which determines the growth of the typical mass:
\begin{equation}
\label{GP:a}
a = \frac{1}{2-\lambda}
\end{equation}
To find another exponent let us establish the growth law of $M_\lambda$. Plugging \eqref{GP:scal} into \eqref{GP:moment} we get $M_\lambda \sim \tau^{(1+\lambda)a-b}$. Combining this result with \eqref{GP:tau} yields
\begin{equation}
\label{GP:tt1}
t\sim \tau^{1+b-(1+\lambda)a}
\end{equation}
Computing the mass density gives another relation between $t$ and the modified time $\tau$:
\begin{equation}
\label{GP:tt2}
t=M(t)\sim \tau^{2a-b}
\end{equation}
Relations \eqref{GP:tt1} and \eqref{GP:tt2} are compatible only when
\begin{equation}
\label{GP:b}
b = \frac{1+2\lambda}{2(2-\lambda)}
\end{equation}

The expressions \eqref{GP:a} and \eqref{GP:b} for the scaling exponents already tell us that the above analysis is inapplicable when $\lambda\geq 2$. For $\lambda>2$ the mathematical framework becomes ill-defined due to instantaneous gelation \cite{EP03}.

Instantaneous gelation is a rather counter-intuitive phenomenon implying that an infinite cluster (`gel') nucleates at time  $t=+0$. Instantaneous gelation was originally discovered in the context of aggregation \cite{dom,hez,spouge,van87}, see \cite{Colm:IG,Leyvraz12} for recent work. Instantaneous gelation also arises in addition processes \cite{BK91} where it was rigorously proved \cite{Non99}. Instantaneous gelation was mostly studied in the mean-field framework, but it may also occur in one dimension  \cite{Evans14,Evans12} where spatial effects are crucial and the mean-field rate equation approach is inapplicable.

In the range $\frac{3}{2}\leq \lambda< 2$, one can employ scaling analysis using the auxiliary time and considering the usual $\tau\to\infty$ regime. One cannot use the original time variable, however. This can be appreciated by using \eqref{GP:a}, \eqref{GP:b} to re-write \eqref{GP:tt2} as $t\sim \tau^{(3-2\lambda)/(4-2\lambda)}$ indicating that consistent behaviors occur only when $\lambda<\frac{3}{2}$. In the $\frac{3}{2}<\lambda< 2$ range the system actually exhibits gelation, namely the gel forms in a finite time. Interestingly, gelation is complete meaning that the entire mass is suddenly transformed into gel. The analysis of the behavior in the gel regime is essentially the same as in un-driven exchange processes with the same kernels \cite{EP03}. Indeed, the most interesting behavior arises close to the gelation point, and the mass density is finite as in the un-driven case. Therefore let us focus on the $\lambda<\frac{3}{2}$ range where clusters grow indefinitely and the emergent scaling behavior differs from the un-driven case.

Instead of the scaling form \eqref{GP:scal}, let us use an equivalent, but slightly more convenient, scaling form
\begin{equation}
\label{GP:scaling}
c_m(\tau) = \tau^{-a/2}\, m^{-\lambda}\,\Phi(\mu), \quad \mu = \frac{m}{\tau^a}\,, \quad  a = \frac{1}{2-\lambda}
\end{equation}
Plugging this scaling form into the governing equation \eqref{GP:cmt} we arrive at the ordinary differential equation
\begin{equation}
\label{GP:FM}
\mu^\lambda \Phi''+a\left[\mu \Phi'+\tfrac{1}{2}\Phi\right] = 0
\end{equation}
Demanding that $\Phi(\mu)$ decays sufficiently rapidly we arrive at a one-parameter family of solutions
\begin{equation}
\label{GP:FM_sol}
\Phi(\mu) = C\, _{1}F_1\big(a/2, 1-a; - a^2 \mu^{1/a}\big)
\end{equation}
in terms of the (confluent) hypergeometric function
\begin{equation*}
_{1}F_1(\alpha, \beta; z) = \frac{\Gamma(\beta)}{\Gamma(\alpha)}\,
\sum_{n\geq 0}\frac{\Gamma(\alpha + n)}{\Gamma(\beta + n)}\,\frac{z^n}{n!}
\end{equation*}

Using \eqref{GP:scaling} and \eqref{GP:FM_sol} we compute the $\lambda^\text{th}$ moment:
\begin{equation}
\label{GP:ML}
M_\lambda = C\,\tau^{a/2} I_1
\end{equation}
with
\begin{equation}
\label{I1}
I_1 = a\int_0^\infty dz\,z^{a-1}\,_{1}F_1(a/2, 1-a; - a^2 z)
\end{equation}
Similarly we compute the first moment, the mass density:
\begin{equation}
\label{GP:M1}
M = t = C\,\tau^{1-a/2} I_2
\end{equation}
with
\begin{equation}
\label{I2}
I_2 = a\int_0^\infty dz\,_{1}F_1(a/2, 1-a; - a^2 z)
\end{equation}

Equation \eqref{GP:tau} tells us that $\frac{dt}{d\tau}=1/M_\lambda$ which is combined with \eqref{GP:ML} to give
\begin{equation*}
\frac{dt}{d\tau}= \tau^{-a/2}\, \frac{1}{CI_1}
\end{equation*}
Differentiating \eqref{GP:M1} with respect to $\tau$ we obtain another expression
\begin{equation*}
\frac{dt}{d\tau}= \tau^{-a/2}\, (1-a/2) CI_2
\end{equation*}
for the same derivative. These two formulas are compatible when
\begin{equation}
C = \frac{1}{\sqrt{(1-a/2) I_1 I_2}}
\end{equation}

Note also the behavior of the total cluster density
\begin{equation}
\label{GP:M0}
N = CI_0\,\tau^{(1-2\lambda)/(4-2\lambda)}=CI_0\left(\frac{t}{CI_2}\right)^{\frac{1-2\lambda}{3-2\lambda}}
\end{equation}
with
\begin{equation}
\label{I0}
I_0 = a\int_0^\infty \frac{dz}{z^a}\,\,_{1}F_1(a/2, 1-a; - a^2 z)
\end{equation}

Let us look more carefully at a few particular values of the homogeneity index.

\subsection{$\lambda=\frac{1}{2}$}
\label{sec:1/2}

The scaled mass distribution substantially simplifies when the homogeneity index is $\lambda=\frac{1}{2}$. In this case the parameters of the confluent hypergeometric function coincide ($\frac{a}{2}=1-a=\frac{1}{3}$), so the function
becomes exponential. More precisely,
\begin{equation}
\label{GP:2d}
\Phi(\mu) = C\,\exp\!\left[-\left(\tfrac{2}{3}\right)^2 \mu^{3/2}\right]
\end{equation}
with
\begin{equation}
\label{C:2d}
C = \left(\frac{2}{3}\right)^{1/6} \left[\Gamma\left(\frac{2}{3}\right)\right]^{-1/2}=0.8031990959\ldots
\end{equation}
The total cluster density in this case saturates at
\begin{equation}
\label{N:2d}
N_\infty = \frac{\pi}{3}\,\left[\frac{2}{\Gamma\big(\frac{2}{3}\big)}\right]^{3/2}= 1.87970144\ldots
\end{equation}

\subsection{Exchange process in $d$ dimensions}

Consider an exchange process supplemented by input of monomers in $d$ spatial dimensions. We assume that clusters are spherical (say because of the surface tension) and that in an exchange event a monomer on the surface of one cluster migrates to the surface of another cluster. This is similar to the model proposed by Schelling \cite{ts} to account for segregation. Another interpretation is an Ising model with infinite-range zero-temperature Kawasaki spin-exchange dynamics \cite{EP03}. The precise relation between all these models is rather subtle, e.g., there is no clear surface tension in the simplest versions of the Schelling and Ising-Kawasaki models, the shape of clusters apparently reflects the lattice structure \cite{EP03}. Coming back to our exchange process we note that the corresponding kernel is the product of the surface areas of the clusters participating in exchange: $K_{i,j}=\sigma_i\sigma_j$. Expressing the area of the cluster and its mass through the radius, $\sigma\sim R^{d-1}$ and $m\sim R^d$, we conclude that $\sigma_m \sim m^{1-1/d}$, so this exchange process is described by the generalized product kernel with $\lambda=1-\frac{1}{d}$.

In one dimension $\lambda=0$, so the exchange process has constant kernel (Sec.~\ref{sec:constant}). In particular, the scaled mass distribution is given by \eqref{FM:1d} and \eqref{C:1d}, the total cluster density grows as $t^{1/3}$, Eq.~\eqref{sum:1/3}. In two dimensions $\lambda=\frac{1}{2}$, so we recover the exchange process described in the previous subsection \ref{sec:1/2}. The scaled mass distribution in two dimensions is given by \eqref{GP:2d}--\eqref{C:2d} and the total cluster density saturates at a constant value, Eq.~\eqref{N:2d}. In three dimensions $\lambda=\frac{2}{3}$, the scaled mass density becomes
\begin{equation}
\label{GP:3d}
\Phi(\mu) = C\, _{1}F_1\big(\tfrac{3}{8}, \tfrac{1}{4}; - \tfrac{9}{16} \mu^{4/3}\big)
\end{equation}
and the total cluster density decays as $t^{-1/5}$. Generally in $d$ dimensions: $N\sim t^{(2-d)/(2+d)}$.

\subsection{$\lambda=-\infty$}
\label{sec:mon-dimer}

For this smallest value of the homogeneity index, the scaling approach is no longer applicable. Yet the analysis of this case is simple since (i) only monomers participate in exchange, and (ii) in addition to monomers injected into the system, only dimers can be formed.

The rate equations \eqref{GP:input} give a single non-trivial equation
\begin{equation}
\label{extreme:c2}
\frac{dc_2}{dt} = c_1^2
\end{equation}
while \eqref{GP:monomer} reduces to
\begin{equation}
\label{extreme:c1}
\frac{dc_1}{d t} = 1 - 2 c_1^2
\end{equation}
Solving \eqref{extreme:c2}--\eqref{extreme:c1} subject to $c_1(0)=c_2(0)=0$ we obtain
\begin{equation}
\label{extreme:c12}
c_1 = \frac{1}{\sqrt{2}}\,\tanh T, \quad c_2 = \frac{1}{2\sqrt{2}}\,[T-\tanh T]
\end{equation}
with $T=t\sqrt{2}$.

\subsection{$\lambda=2$}

The value $\lambda=2$ of the homogeneity index is another extreme: It separates the $\frac{3}{2}<\lambda\leq 2$ region where the gel is formed from the $\lambda>2$ region where instantaneous gelation occurs. The simplest way to convince oneself in the emergence of a gel, and to establish the gelation time, is to look at the moments of the cluster mass distribution. In the particular case of $\lambda=2$ the equations for (integer) moments are {\em recurrent}, and hence solvable. For instance,
\begin{equation}
\label{M234}
\begin{split}
&\frac{dM_2}{dt} = 1+2M_2^2 \\
&\frac{dM_3}{dt} = 1+6M_2 M_3 \\
&\frac{dM_4}{dt} = 1+2M_2^2+12M_2 M_4
\end{split}
\end{equation}
Solving these equations one obtains
\begin{equation}
\label{M234:sol}
\begin{split}
&M_2 = \frac{\tan T}{\sqrt{2}} \\
&M_3 = \frac{\tan T+ \tfrac{2}{3} (\tan T)^3}{\sqrt{2}}\\
&M_4 = \frac{\frac{3T}{(\cos T)^6} + 5\tan T+ 8(\tan T)^3 + 3(\tan T)^5}{8\sqrt{2}}
\end{split}
\end{equation}
where we again used the shorthand notation $T=t\sqrt{2}$. All the moments diverge at $T_c=\pi/2$. This determines the gelation time: $T_c=\pi/2$, or $t_c=\pi/\sqrt{8}$. Using \eqref{M234:sol} we establish the divergence of the moments
\begin{equation}
\label{M234:gel}
\begin{split}
&M_2 \simeq \frac{1}{2}\,(t_c-t)^{-1} \\
&M_3 \simeq \frac{1}{6}\,(t_c-t)^{-3} \\
&M_4 \simeq \frac{3\pi\sqrt{2}}{256}\,(t_c-t)^{-6}
\end{split}
\end{equation}
near the gelation time. Generally
\begin{equation}
\label{Mn:gel}
M_n\sim (t_c-t)^{-n(n-1)/2}
\end{equation}
for the $n^\text{th}$ moment. Therefore the moments of the cluster mass distribution exhibit a multi-scaling behavior.

The divergence of the moments \eqref{Mn:gel} and multi-scaling also arise in the un-driven case \cite{EP03} and they can be understood using similar arguments. The idea is to use \eqref{GP:cmt} with $\lambda=2$. The auxiliary time variable is now
\begin{equation}
\label{GP:tau-2}
\tau = \int_0^t dt'\,M_2(t')= -\frac{1}{2}\, \ln(\cos T)
\end{equation}
Since the auxiliary time diverges as $T\to T_c=\pi/2$, we can use continuum approaches; in particular, we can rely on the partial-differential equation \eqref{GP:cmt}. As explained in Ref.~\cite{EP03}, the cluster mass distribution attains (for large masses) a log-normal form
\begin{equation}
\label{log-normal}
c_m(\tau)\sim e^{-\tau/4} m^{-3/2} \exp\!\left[-\frac{(\ln m)^2}{4\tau}\right]
\end{equation}
As a consistency check, let us compute the mass density. We write $\kappa = \ln m$ and find
\begin{equation*}
\sum_{m\geq 1}mc_m \sim e^{-\tau/4} \int_0^\infty d\kappa\,\exp\!\left[\frac{\kappa}{2}-\frac{\kappa^2}{4\tau}\right]
                                    \to    \text{const}
\end{equation*}
as $\tau\to\infty$. The mass density is $M=t$, so it does approach a finite value at the gel point: $M\to t_c=\pi/\sqrt{8}$
Similarly, the $n^\text{th}$ moment grows as
\begin{eqnarray*}
\sum_{m\geq 1}m^n c_m &\sim&
 e^{-\tau/4} \int_0^\infty d\kappa\,\exp\!\left[\kappa\left(n-\frac{1}{2}\right)-\frac{\kappa^2}{4\tau}\right]\\
                                         &\sim& e^{n(n-1)\tau}
\end{eqnarray*}
This reduces to \eqref{Mn:gel} once we notice [see \eqref{GP:tau-2}] that
\begin{equation}
\label{tau:t}
e^{2\tau}= \frac{1}{\cos T} \simeq \frac{1}{\sqrt{2}}\,(t_c-t)^{-1}
\end{equation}

The moments with $n\geq 1$, and even non-integer moments with $n>\frac{1}{2}$, behave according to \eqref{Mn:gel}. The zeroth moment, i.e., the total cluster density, exhibits a special behavior. This becomes evident once we note that $\sum_{m\geq 1}m^{-3/2}$ converges. Therefore $N\sim  e^{-\tau/4}$. Using \eqref{tau:t} we conclude that
\begin{equation}
\label{N:extreme-gel}
N(t) \sim (t_c-t)^{1/8}
\end{equation}
Vanishing of the total cluster density at $t_c$ shows that gelation is complete, namely the entire mass of the system is suddenly transformed into gel.

\section{Exchange Processes Driven by a Localized Source}
\label{sec:local}

In previous sections we considered mass exchange processes supplemented by homogeneous input. Here we investigate the behaviors when input is spatially localized. The densities $c_m(\mathbf{r},t)$ then evolve according to a  system of partial differential equations
\begin{eqnarray}
\label{loc:cmt}
\frac{\partial c_m}{\partial t} &=& \sum_{i,j} c_i c_j K_{i,j} \left[\delta_{m,i+1}+\delta_{m,i-1}-2\delta_{m,i}\right]
 \nonumber\\
&+&  D_m\nabla^2 c_m  + J \delta_{m,1}\delta(\mathbf{r})
\end{eqnarray}
The first term on the right-hand side of Eq.~\eqref{loc:cmt} accounts for exchange events. In writing the second term we have assumed that the transport mechanism is diffusion;  the diffusion coefficients $D_m$ generally depend on the mass $m$. The last term represents the localized source, namely the constant flux of monomers (with intensity $J$) at the origin. It suffices to model flux with delta function $\delta(\mathbf{r})$ since we are interested in distances greatly exceeding the size of the region where the monomers are injected.

An infinite system of coupled non-linear partial differential equations \eqref{loc:cmt} possesses an outstanding challenge. Similar equations have been studied in the context of aggregation with a localized source \cite{Sid89,PLK:source,PLK:3particle}, and models with mass-independent diffusion coefficients proved to be much more amenable to analyses. For exchange processes with spatially varying densities, the situation is the same. One can already suspect this by noting that when $D_m=D= \text{const}$, the mass density satisfies a closed partial differential equation, the diffusion equation with a localized source:
\begin{equation}
\label{loc:M}
\frac{\partial M}{\partial t} =  D \nabla^2 M + J \delta(\mathbf{r})
\end{equation}
Hence the mass density is known and totally independent on the mass exchange:
\begin{equation}
\label{loc:M-sol}
M(\mathbf{r},t) = J\int_0^t \frac{dt'}{(4\pi D t')^{d/2}}\,\exp\!\left[-\frac{r^2}{4Dt'}\right]
\end{equation}
in $d$ dimensions.

We limit ourselves to the physically most relevant three-dimensional case. In three dimensions, the mass density is asymptotically time-independent:
\begin{equation}
\label{loc:M-3d}
M = \frac{J}{4\pi D r}
\end{equation}

More precisely, the mass density is described by the Coulomb law \eqref{loc:M-3d} when $r\ll \sqrt{Dt}$. In the following we consider physically most important three-dimensional case and focus on the region $r\ll \sqrt{Dt}$ where not only the mass density but all cluster densities are stationary.

We now analyze two basic reaction kernels, the product kernel and the constant kernel, and then mention chief behaviors for the generalized product kernels. At the end of this section we show that scaling approaches still apply to models in which diffusion coefficients vary with mass algebraically (specifically, we discuss models with $D_m\sim m^{-1}$).

\subsection{Product Kernel}
\label{sec:loc_PK}

For the product kernel $K_{i,j}=Kij$, the governing equations in the stationary regime read
\begin{eqnarray}
\label{loc:cm}
0 &=& \frac{\sigma}{r}[(m+1)c_{m+1}-2mc_m+(m-1)c_{m-1}]  \nonumber\\
&+&  \nabla^2 c_m  + \frac{J}{D}\, \delta_{m,1}\delta(\mathbf{r})
\end{eqnarray}
where
\begin{equation}
\label{sigma}
\sigma = \frac{JK}{4\pi D^2}
\end{equation}
In this section, dimension-full quantities are used (apart from the mass of monomers which is still set to unity). The densities have dimension of the inverse volume, so $[c_m]=L^{-3}$ when $d=3$. The dimensions of the main parameters of the problem are
\begin{equation}
[J] = T^{-1},\quad [D] = L^2 T^{-1},\quad [K] = L^3 T^{-1}
\end{equation}
Thus $\sigma$ has dimension of the inverse length: $[\sigma]=L^{-1}$.

For large masses we can treat $m$ as a continuous variable. The density $c=c_m(r)$ satisfies
\begin{equation}
\label{loc:cmr}
\frac{\sigma}{r}\,\frac{\partial^2 (mc)}{\partial m^2}+ \nabla^2 c = 0
\end{equation}
Balancing terms gives $\frac{\sigma}{mr}\sim \frac{1}{r^2}$, so the typical mass increases linearly with distance: $m \sim \sigma r$. This together with the Coulomb law \eqref{loc:M-3d} for the mass density lead to the scaling form for the cluster mass distribution:
\begin{equation}
\label{loc:scaling}
c_m(r) = \frac{D\sigma^2}{K}\, (\sigma r)^{-3} F(\mu), \qquad \mu = \frac{m}{\sigma r}
\end{equation}
The scaling form \eqref{loc:scaling} is compatible with the Coulomb law \eqref{loc:M-3d} when
\begin{equation}
\label{loc:FM-1}
\int_0^\infty d\mu\,\mu F(\mu)=1
\end{equation}

One can re-write \eqref{loc:scaling} in a manifestly dimensionless form
\begin{equation*}
\frac{c_m(r)}{\sigma^3} = \frac{D}{K\sigma}\, (\sigma r)^{-3} F(\mu)
\end{equation*}
In this and many other equations the distance $r$ from the origin naturally appears as a dimensionless combination $\sigma r$. The dimensionless parameter
\begin{equation*}
\frac{D}{K\sigma} = 4\pi\,\frac{D^3}{JK^2}
\end{equation*}
provides the proper measure of the strength of the flux.

By inserting \eqref{loc:scaling} into \eqref{loc:cmr} we obtain
\begin{equation}
\label{loc:FM}
(\mu^2+\mu)F''+(6\mu + 2)F+6F = 0
\end{equation}
The general solution of this equation is
\begin{equation*}
F(\mu) = \frac{C_1+ C_2\left(\mu+2\ln\mu - \mu^{-1}\right)}{(\mu+1)^3}
\end{equation*}
This scaled mass distribution has the small mass singularity unless $C_2=0$. Equation \eqref{loc:FM-1} fixes another amplitude: $C_1=2$. Thus $F= 2(\mu+1)^{-3}$ and \eqref{loc:scaling} becomes
\begin{equation}
\label{loc:cm-sol}
c_m(r) = \frac{2D\sigma^2}{K}\, \frac{1}{(m+\sigma r)^3}
\end{equation}
In particular, the density of monomers is
\begin{equation}
\label{loc:mon-sol}
c_1(r) = \frac{2D}{K\sigma}\,r^{-3}
\end{equation}
The total cluster density is also given by a neat formula
\begin{equation}
\label{loc:N-sol}
N(r) = \frac{D}{K}\,r^{-2}
\end{equation}

The asymptotic behaviors \eqref{loc:mon-sol}--\eqref{loc:N-sol} are valid far away from the origin, more precisely when $r\gg \sigma^{-1}$. This is already evident from \eqref{loc:cm-sol}. Another way to see this is to consider the governing equation for $N(r)$ which is obtained by summing \eqref{loc:cm} for all $m\geq 1$:
\begin{equation}
\label{loc:N-eq}
0 =-\frac{\sigma}{r} c_1 + \nabla^2 N  + \frac{J}{D}\,\delta(\mathbf{r})
\end{equation}
One immediately verifies that \eqref{loc:mon-sol}--\eqref{loc:N-sol} agree with \eqref{loc:N-eq}. Near the origin, the source term dominates over reaction, so the total density is $N=J/(4\pi D r)$. Comparing this result with
\eqref{loc:N-sol} we see that the crossover indeed occurs when $r\sim \sigma^{-1}$.

The total cluster density is given by \eqref{loc:N-sol} up to distance of the order of $\sqrt{Dt}$ and it quickly vanishes for larger distances. Hence $\mathcal{N}(t)\sim \int_0^{\sqrt{Dt}} dr\,4\pi r^2 N(r)$ estimates
the total number of clusters in the system. Using \eqref{loc:N-sol} we obtain
\begin{equation}
\label{loc:all}
\mathcal{N}\sim \frac{D}{K}\, \sqrt{Dt}
\end{equation}

\subsection{Constant Kernel}
\label{sec:loc_CK}

For the constant reaction kernel, $K_{i,j}=K$, the governing equations in the stationary regime become
\begin{equation}
\label{loc:const}
0 \!=\!  NK[c_{m+1}-2c_m+c_{m-1}]  +D\nabla^2 c_m  + J \delta_{m,1}\delta(\mathbf{r})
\end{equation}
In the continuum limit the density $c=c_m(r)$ satisfies
\begin{equation}
\label{loc:cmr-const}
\frac{NK}{D}\,\frac{\partial^2 c}{\partial m^2}+ \nabla^2 c = 0
\end{equation}
Balancing the terms of this equation yields $\frac{NK}{D m^2}\sim \frac{1}{r^2}$, leading to $m\sim\sqrt{NKr^2/D}$. Another estimate of the typical mass is $m\sim M/N$. Balancing these estimates and using \eqref{loc:M-3d} we get
\begin{equation}
\label{loc:N-estimate}
N \sim \frac{D}{K}\,\sigma^{2/3} r^{-4/3}, \quad m\sim \sigma^{1/3} r^{1/3}
\end{equation}

These estimates determine an appropriate scaling form for the cluster mass distribution, e.g., as a scaled mass one should use $m/(\sigma r)^{1/3}$. Putting such a form into \eqref{loc:cmr-const} and solving the resulting ordinary differential equation one finds the scaled mass distribution. The results are less cumbersome if we write $c_m(r)$ as
\begin{equation}
\label{loc:scaling-const}
c_m(r) = \frac{D\alpha^2}{K}\,(\alpha r)^{-5/3}\, F(\mu), \qquad \mu = \frac{m}{(\alpha r)^{1/3}}
\end{equation}
where instead of $\sigma$ defined by Eq.~\eqref{sigma} we use
\begin{equation}
\alpha = \frac{36\sigma}{\pi} = \frac{9JK}{\pi^2 D^2}
\end{equation}
The scaled mass distribution then reads
\begin{equation}
\label{loc:FM-const}
F(\mu) = \frac{4}{9}\,\frac{\mu}{(\mu^2+1)^3}
\end{equation}
The density of monomers is
\begin{equation}
\label{loc:mon-const}
c_1(r) = \frac{4D}{9K}\,r^{-2}
\end{equation}
and the total cluster density is
\begin{equation}
\label{loc:N-const}
N(r) = \frac{D}{9K}\,\frac{\alpha^{2/3}}{r^{4/3}}
\end{equation}
Near the origin the total density is $N=J/(4\pi D r)$ which again crosses over to \eqref{loc:N-const} at $r\sim \sigma^{-1}$.

Using \eqref{loc:N-const} we find an estimate for the total number of clusters in the system:
\begin{equation}
\label{loc:all-const}
\mathcal{N}\sim \frac{D}{K}\, \sigma^{2/3} (Dt)^{5/6}
\end{equation}

\subsection{Generalized Product Kernels}

In the continuum limit the density $c=c_m(r)$ satisfies
\begin{equation}
\label{loc:cmr-GPK}
\frac{M_\lambda K}{D}\,\frac{\partial^2 (m^\lambda c)}{\partial m^2}+ \nabla^2 c = 0
\end{equation}
The same arguments as in the previous subsections lead to the scaling form
\begin{equation}
\label{loc:scaling-GPK}
c_m(r) = \frac{D}{K}\,\frac{\sigma^2}{(\sigma r)^{1+2\Lambda}}\, F(\mu), \qquad \mu = \frac{m}{(\sigma r)^\Lambda}
\end{equation}
where $\Lambda=1/(3-2\lambda)$. We omit a rather complicated solution for the scaled mass distribution and only mention the asymptotic for the total cluster density
\begin{equation}
\label{loc:N-GPK}
N(r) \sim \frac{D}{K}\,\frac{\sigma^{1-\Lambda}}{r^{1+\Lambda}}
\end{equation}
and for the total number of clusters in the system
\begin{equation}
\label{loc:all-GPK}
\mathcal{N}\sim \frac{D}{K \sigma}\,(\sigma^2 Dt)^{1-\Lambda/2}
\end{equation}

Equations \eqref{loc:scaling-GPK}--\eqref{loc:all-GPK} provide a proper description only if the total number of clusters diverges in the $t\to\infty$ limit. This together with \eqref{loc:all-GPK} give $\Lambda<2$ implying that the index $\lambda$ of the generalized product kernels must obey $\lambda<\frac{5}{4}$. Indeed, the rate equation framework which was used in the derivations is deterministic, so its applicability is based on the assumption that the total number of clusters in the system is infinite. For systems with finite number of clusters, there are always fluctuations. In the exchange processes with a localized source the total number of clusters is of course finite, but since we are interested in the large time limit the emergent results are consistent only when $\lim_{t\to\infty} \mathcal{N}(t)=\infty$.

\subsection{Models with $D_m=m^{-1}$}
\label{sec:inverse}

The assumption that the diffusion coefficients do not depend on mass was crucial in the preceding analysis. The diffusion coefficients generally decrease with mass, however. The decay is usually algebraic, $D_m\sim m^{-\nu}$; see \cite{einstein} for arguments in favor of specific values of the mobility exponent (e.g. $\nu=1$ and $\nu=3/2$ in some problems involving two-dimensional clusters). It turns out the models with mass-dependent algebraically decaying diffusion coefficients are still tractable. The idea is to assume the emergence of a stationary mass distribution and the validity of scaling. Whenever the results are consistent, one hopes that they are asymptotically exact.

For concreteness, let us look at a set of models with diffusion coefficients inversely proportional to the mass, $D_m=D/m$. For such models, the mass density varies as
\begin{equation}
\label{loc:MN-inverse}
\frac{\partial M}{\partial t} =  D \nabla^2 N + J \delta(\mathbf{r})
\end{equation}
In the long time limit the left-hand side of Eq.~\eqref{loc:MN-inverse} tends to zero, so the cluster density is
\begin{equation}
\label{loc:Coulomb}
N = \frac{J}{4\pi D r}
\end{equation}
(Recall, that we consider the three-dimensional case.) We know $N(r)$, so the model with constant kernel is the simplest. In that model, the densities satisfy
\begin{equation}
\label{loc:inverse-steady}
0 = \frac{\sigma}{r}[c_{m+1}-2c_m+c_{m-1}]  + \nabla^2 \frac{c_m}{m}  + \frac{J}{D}\, \delta_{m,1}\delta(\mathbf{r})
\end{equation}
The scaling solution is found using the same techniques as previously to yield
\begin{equation}
\label{loc:cm-inverse}
c_m(r) = \frac{2D\sigma^2}{K}\, \frac{m}{(m+\sigma r)^3}
\end{equation}

The monomer density is given by exactly the same formula \eqref{loc:mon-sol} as in the model with product kernel and mass-independent diffusion coefficients, but other densities differ. Using \eqref{loc:cm-inverse}, we compute the mass density
\begin{equation}
\label{loc:M-inverse}
M(\mathbf{r},t) = \frac{2D\sigma^2}{K} \left[\int_{\sigma r}^{m_\text{max}} \frac{dz}{z}-\frac{3}{2}\right]
\end{equation}
An estimate $r\sim\sqrt{Dt/m_\text{max}}$ gives $m_\text{max}\sim Dt/r^2$. Thus
\begin{equation}
\label{loc:M-log}
M(r,t) = \frac{2D\sigma^2}{K} \left[\ln(\sigma^2 Dt)- 3\ln(\sigma r)-\frac{3}{2}\right]
\end{equation}

Models with $D_m=D/m$ and non-constant kernels are more complicated. Let's try, however, to probe chief behaviors relying on scaling and assuming the emergence of a stationary mass distribution. For models with generalized product kernel we arrive at a familiar scaling form
\begin{equation}
\label{loc:inverse-gen}
c_m(r) = \frac{D}{K}\,\frac{\sigma^2}{(\sigma r)^{1+\delta}} F(\mu), \qquad \mu = \frac{m}{(\sigma r)^\delta}
\end{equation}
with $\delta = 1/(1-2\lambda)$. Even the the mass distribution is stationary, the mass density may be non-stationary as it is already exemplified by Eq.~\eqref{loc:M-inverse} in the case of $\lambda=0$. Using the scaling form \eqref{loc:inverse-gen} we arrive at an estimate of the mass density
\begin{equation}
\label{loc:M-steady}
M(r) \sim \frac{D}{K} \sigma^{\frac{2-2\lambda}{1-2\lambda}}r^{\frac{2\lambda}{1-2\lambda}}
\end{equation}
The dependence of $M(r)$ on the distance suggests that the mass density is stationary for $\lambda<0$. Using mass conservation, $\int_0^{r_\text{max}}dr\,r^2 M(r)\sim Jt$, we conclude that \eqref{loc:M-steady} is valid for $r<r_\text{max}$ with
\begin{equation}
\label{loc:max-1}
\sigma r_\text{max}\sim (\sigma^2 Dt)^{\frac{1-2\lambda}{3-2\lambda}}
\end{equation}
and the mass density quickly vanishes for $r>r_\text{max}$.

A more rigorous derivation of \eqref{loc:M-steady} in the $\lambda<0$ region could be obtained if we determine the scaled mass distribution. By inserting the scaling form \eqref{loc:inverse-gen} into
\begin{equation}
\frac{M_\lambda K}{D}\,\frac{\partial^2 (m^\lambda c)}{\partial m^2}+ \nabla^2 \frac{c}{m} = 0
\end{equation}
we obtain
\begin{equation}
\label{loc:FM-inv}
\frac{1}{2}\,\mu F'' + (2-\lambda) F' + \frac{1-\lambda}{\mu}\,F + I_\lambda (\mu^\lambda F)''=0
\end{equation}
with $I_\lambda=\frac{1}{2}(1-2\lambda)^2\int_0^\infty d\mu\,\mu^\lambda F(\mu)$.  Apart from the already solved case of $\lambda=0$, Eq.~\eqref{loc:FM-inv} apparently does not have solutions in terms of known special functions. Still, the large mass limit can be probed analytically. In this limit, the last term in Eq.~\eqref{loc:FM-inv} is negligible.
Dropping this term and solving the resulting equation we obtain
\begin{equation}
\label{loc:FM-inv-sol}
F \sim \mu^{-2(1-\lambda)}\quad\text{for}\quad \mu\gg 1
\end{equation}
For $\lambda<0$, the integral $\int^\infty d\mu\,\mu F(\mu)$ converges and hence the mass density does scale according to \eqref{loc:M-steady}.

When $0<\lambda< \frac{1}{2}$, the mass density is non-stationary:
\begin{eqnarray}
\label{loc:M-steady-2}
M (r,t) &\sim&  \frac{D\sigma^2}{K}\,(\sigma r)^{\delta -1} \int_0^{\mu_\text{max}} d\mu\,\mu F(\mu)\nonumber\\
&\sim&  \frac{D\sigma^2}{K}\,(\sigma r)^{\delta -1} \int_0^{Dt/[r^2(\sigma r)^\delta]}
d\mu\,\mu^{2\lambda-1}\nonumber\\
&\sim&  \frac{D\sigma^2}{K}\left(\!\frac{Dt}{r^2}\right)^{2\lambda}
\end{eqnarray}
where we have used an estimate $m_\text{max}\sim Dt/r^2$. Also for $0<\lambda< \frac{1}{2}$, Eq.~\eqref{loc:M-steady-2} is valid for $r<r_\text{max}$ with
\begin{equation}
\label{loc:max-2}
\sigma r_\text{max}\sim (\sigma^2 Dt)^{(1-2\lambda)/(3-4\lambda)}
\end{equation}

Using \eqref{loc:Coulomb} together with the estimates \eqref{loc:max-1} and \eqref{loc:max-2} of the maximal distance we find that the total number of clusters scales as
\begin{equation}
\label{loc:all-inv}
\mathcal{N}\sim \frac{D}{K \sigma}\,(\sigma^2 Dt)^{\beta}
\end{equation}
with
\begin{equation*}
\beta = 2(1-2\lambda)\times
\begin{cases}
(3-2\lambda)^{-1}  & \lambda<0\\
(3-4\lambda)^{-1}  & 0<\lambda<\frac{1}{2}
\end{cases}
\end{equation*}

The above predictions are inconsistent when $\lambda\geq \frac{1}{2}$. The most natural guess is that the cluster mass distribution does not reach a stationary regime in this region. It would be interesting to develop a quantitative understanding of the behavior in the $\lambda\geq \frac{1}{2}$ region.

\section{Conclusions and Discussion}
\label{sec:conl}

We studied mass exchange processes driven by a source of monomers. We considered both homogeneous and localized input. For processes with homogeneous source, we employed scaling methods and analyzed in detail three basic exchange kernels---the product kernel, the sum kernel, and the constant kernel; we also probed a one-parameter family of generalized product kernels. We also exactly solved the mass exchange process with product reaction kernel supplemented by the homogeneous source of monomers. In all these systems, a steady state is never reached. A generalization of our approach to exchange processes with kernels $K_{i,j}=i^aj^b+i^bj^a$ and homogeneous input seemingly leads to the same conclusion. It would be interesting to find a general proof that steady states are impossible in exchange processes driven by a homogeneous source.

We showed that the mass exchange processes with spatially localized input can be {\em simpler} than the corresponding processes with homogeneous input. This is obvious e.g. by comparing the cluster mass distributions for the exchange process with product kernel: Eqs.~\eqref{cmt:scaling} and \eqref{F:sol_B} for the homogeneous input and Eq.~\eqref{loc:cm-sol} for the localized input. The chief reason is that the cluster mass distribution is often stationary when the source is spatially localized. We demonstrated that stationary mass distributions naturally emerge for exchange processes with mass-independent diffusion coefficients, e.g., for exchange processes with generalized product kernel, $K_{i,j}=(i j)^\lambda$ with $\lambda<\frac{5}{4}$, where the bound on the homogeneity index assures that the deterministic rate equation description is asymptotically relevant.

We outlined possible behaviors for the mass exchange processes with spatially localized input in the situations when diffusion coefficients depend on mass. Specifically, we analyzed models in which diffusion coefficients are inversely proportional to the mass. We presented evidence that the cluster size distribution may not reach a stationary state. This depends on the details of the exchange kernel; e.g., for exchange processes with generalized product kernel a stationary state is apparently never reached when $\lambda>\frac{1}{2}$. The behaviors in the continuously evolving regime are the challenge for future work.

The power of scaling in the context of exchange processes is impressive. Another general lesson is that seemingly intractable systems of infinitely many coupled non-linear partial differential equations for spatially varying densities can be simpler than their homogeneous counter-parts. This is not clear a priori, and even the emergence of the stationary distribution does not make the spatial problem manifestly simpler as it involves the Laplace operator rather than the first derivative in time.

Finally we mention that exchange processes often occur in low spatial dimensions where the rate equation approach is invalid. It would be interesting to analyze simplest exchange processes in one dimension.


\section{Introduction}
Given a rational polytope $P\subset \R^d$ (that is, a bounded subset
of $\R^d$ which is defined by a finite collection of integer linear
inequalities), define the function
\[i_P(t) = \#(tP\cap\Z^d),\]
where $tP$ is $P$ dilated by a factor of $t$. Also define $\D=\D(P)$
to be the smallest $\D\in \Z_+$ such that $\D\cdot P$ has integral
vertices.  Ehrhart proved \cite{Ehrhart62} that $i_P(t)$ is a
quasi-polynomial function with a period of $\D$. In other words,
there exist polynomial functions $f_0(t), f_1(t), \ldots ,
f_{D-1}(t)$, called the \emph{constituents} of $i_P(t)$, such that
\[i_P (t) = f_j(n)\text{ for }t \equiv j \mod{\D}.\]

\begin{example}
$P=[0,\frac{1}{2}]\times [0,\frac{1}{2}]\subset \R^2.$
\end{example}
Then
\[i_P(t)=\left\{%
\begin{array}{ll}
    \left(\frac{t+2}{2}\right)^2, & \hbox{for $t$ even} \\
    \left(\frac{t+1}{2}\right)^2, & \hbox{for $t$ odd} \\
\end{array}%
\right. .\] \boxend

We know that $\D$ is \emph{a} period of the quasi-polynomial
$i_P(t)$.  What is the \emph{minimum} period?  Certainly, it must
divide $\D$.  In most cases, in fact, it is exactly $\D$.  In
certain interesting examples, however, the minimum period is
smaller.

\begin{example}
Given partitions $\lambda$ and $\mu$, define the Gelfand-Tsetlin
polytope $P=P_{\lambda\mu}\subset\R^N$, as in \cite{DM03} (following
the classic \cite{GC50}), where $N$ is defined in terms of the
lengths of $\lambda$ and $\mu$.
\end{example}
Then $\#(P\cap\Z^N)$ is the dimension of the weight $\mu$ subspace
of the irreducible representation of $\mathrm{GL}_n\C$ with highest
weight $\lambda$. Though
\[i_P(t)=\#(P_{t\lambda,t\mu}\cap\Z^N)\] is a polynomial, that is, it has period one (see
\cite{KR86}), $\D(P)$ may be made arbitrarily large by suitable
choice of $\lambda$ and $\mu$ (see \cite{DM03}).

\boxend

\begin{example}
More generally, given partitions $\lambda,$ $\mu,$ and $\nu$ such
that $\abs{\lambda}+\abs{\mu}=\abs{\nu}$, define the \emph{hive
polytope} $P=P_{\lambda\mu}^{\nu}\subset\R^N$ as in \cite{Buch00}
(an exposition of ideas from \cite{KT99}), where $N$ is defined in
terms of the length of $\lambda,$ $\mu,$ and $\nu$.
\end{example}
Then $\#(P\cap\Z^N)$ is the Littlewood-Richardson coefficient
$c_{\lambda\mu}^\nu$, defined to be the multiplicity of $V_{\nu}$
(the highest weight representation of $\mathrm{GL}_n(\C)$
corresponding to $\nu$) in $V_{\lambda}\otimes V_{\mu}$.  Though
\[i_P(t)=\#(P_{t\lambda,t\mu}^{t\nu}\cap\Z^N)\]
is a polynomial (see \cite{DW02}), $\D(P)$ need not be one. \boxend

\begin{example}
Given any $\D\subset\Z_+$ and any $s$ dividing $\D$, let $P$ be the
pentagon with vertices $(0,0), (0,-\frac{1}{s}), (\D,-\frac{1}{s}),
(\D,0),$ and $(1,\frac{\D-1}{\D})$.
\end{example}
In \cite{MW04}, it is shown that this pentagon has $\D(P)=\D$, but
has minimum period $s$. \boxend

These examples raise several questions: When is the minimum period
of $i_p(t)$ less than $\D(P)$?  When is $i_P(t)$ a polynomial?  How
can we tell what the minimum period of $i_P(t)$ is? These questions
are wide-open, though \cite{MW04} gives a geometric characterization
of the polygons $P\subset\R^2$ such that $i_P(t)$ is a polynomial.
Here, we attack these questions from a computational perspective.
Can we find algorithms to answer these questions ``quickly?''

Let us be more precise.  We define the \emph{input size} of an
algorithm to be the number of bits needed to encode the input into
binary.  In particular, the input size of an integer $a$ is
approximately $1+\log_2\abs{a}$ (the number of digits needed to
write $a$ in binary).  An algorithm is called \emph{polynomial time}
if the number of steps it takes is bounded by a certain polynomial
in the input size.  Proving that an algorithm is polynomial time is
generally regarded as proving that it is ``quick,'' at least
theoretically.  See \cite{Papa94} for general background on
algorithms and computation complexity.

Our algorithms will take as input a polytope $P$.  The input size of
a polytope defined by $n$ linear inequalities $\langle
c_i,x\rangle\le b_i$, where $c_i\in\Z^d, b_i\in\Z$, is approximately
\[nd+\sum_{i,j}\log_2\abs{c_{ij}}+\sum_i\log_2\abs{b_i}.\]

We can now state the main theorem, which we will prove in Section 4.

\begin{theorem}
\label{PeriodCheck} Fix $d$.  There is a polynomial time algorithm
which, given a rational polytope $P\subset \R^d$ and an integer
$n>0$, decides whether $n$ is a period of the quasi-polynomial
$i_P(t)$.

In particular, there is a polynomial time algorithm which decides
whether $i_P(t)$ is a polynomial (that is, whether $n=1$ is a
period).
\end{theorem}

\ \\

It is important that we fix $d$ in this theorem, because problems of
this sort become intractable if $d$ is allowed to vary. For example,
the problem of deciding whether $P$ contains an integer point is
NP-hard if $d$ is not fixed.

Na\"{i}vely applying Theorem \ref{PeriodCheck} yields an algorithm
to find the minimum period of $i_P(t)$ which, unfortunately, is not
polynomial time.  We would have to factor $\D(t)$, which would give
us a set of possible $n$, one of which must be the minimal period.
We will prove the following corollary in Section 4.  By a
\emph{polynomial-time reduction}, of Problem A to Problem B, we mean
that, if there was some oracle which could solve Problem B
instantaneously (more precisely, in the amount of time it takes to
output the answer to Problem B), then we could use that oracle to
get a polynomial time algorithm for Problem A.  In other words,
Problem A is ``as easy as'' Problem B.

\begin{cor}
\label{Reduction} Fix $d$.  There is a polynomial-time reduction of
the problem of finding the minimum period of $i_P(t)$, where $P$ is
a $d$-dimensional polytope, to the problem of factoring a natural
number $\D$.
\end{cor}

\ \\

Unfortunately, the problem of factoring is probably hard.  It is not
known to be polynomial time (read, not too hard) or NP-hard (read,
very hard) and is probably somewhere in between.  Nevertheless, we
make the following conjecture.

\begin{conj}
Fix $d$.  There is a polynomial time algorithm, which, given a
$d$-dimensional polytope $P$, computes the minimum period of
$i_P(t)$.
\end{conj}

\ \\

The tools we will use are \emph{rational generating functions}.
Given a set $S\subset\Z^d$, define the generating function
\[f(S;\x)=\sum_{a=(a_1,\ldots,a_d)\in
S}x_1^{a_1}x_2^{a_2}\cdots x_d^{a_d}=\sum_{a\in S}\x^a.\] Sets that
are very large can sometimes be written compactly as rational
generating functions in the form \begin{equation} \label{GFForm}
f(S;\x)=\sum_{i\in I}\alpha_i
\frac{\x^{p_i}}{(1-\x^{b_{i1}})(1-\x^{b_{i2}})\cdots(1-\x^{b_{ik_i}})},
\end{equation}
 where $\x\in \C^d$, $\alpha_i\in\Q$, $p_i\in\Z^d$, and $b_{ij}\in\Z^d\setminus
0$.

\begin{example}
$S=\{0,1,2,\ldots,n\}$, for some $n$.
\end{example}
Then \begin{align*}f(S;x)&=1+x+x^2+\cdots+x^n\\
&=\frac{1-x^{n+1}}{1-x}.
\end{align*}
\boxend

In Section 2, we present several tools to compute and to manipulate
rational generating functions, most of which were proved in either
\cite{BP99} or \cite{BW03}.

Given a rational polytope $P\subset\R^d$, define the generating
function
\[F_P(t,z)=f_0(t)+f_1(t)z+\cdots+f_{\D-1}(t)z^{\D-1},\]
where the $f_i(t)$ are the constituents of $i_P(t)$.  In Section 3,
we will prove the following proposition, which will be useful in the
proof of Theorem \ref{PeriodCheck}.

\begin{prop}
\label{QPGF} Fix $d$.  There is a polynomial time algorithm which,
given a rational polytope $P$, computes $F_P(t,z)$ as a rational
generating function of the form (\ref{GFForm}).
\end{prop}

\ \\

Finally, in Section 4, we prove Theorem \ref{PeriodCheck} and
Corollary \ref{Reduction}.

\section{Rational generating function tools}
In this section, we present several tools to compute and manipulate
rational generating functions.  Except for Lemma \ref{DecideEqual},
which is proved here, they were proved in either \cite{BP99} or
\cite{BW03}.

First we present a tool for creating rational generating functions.

\begin{theorem}\label{BarvPolyhedron} (Theorem 4.4 of \cite{BP99}) Fix $d$.  Then there exists a
polynomial time algorithm which, for any given rational polyhedron
$P\subset\R^d$, computes $f(P\cap\Z^d;\x)$ in the form
\[f(P\cap\Z^d;\x)=\sum_{i\in I}\epsilon_i
\frac{\x^{p_i}}{(1-\x^{a_{i1}})(1-\x^{a_{i2}})\cdots(1-\x^{a_{id}})},\]
where $\epsilon_i\in\{-1,+1\}$, $p_i,a_{ij}\in\Z^d$, and $a_{ij}\ne
0$ for all $i,j$.  In fact, for each $i$,
$a_{i1},a_{i2},\ldots,a_{id}$ is a basis of $\Z^d$.
\end{theorem}

\ \\

\begin{example}
$P$ is the interval $[0,n]$.
\end{example}
Then $P\cap\Z=\{0,1,2,\ldots,n\}$, and we have already computed
$f(P\cap\Z)=\frac{1-x^{n+1}}{1-x}$. \boxend

Once we have computed some rational generating functions, we also
have several tools to manipulate them.

Let $f(\x)$, with $\x\in\C^d$, be a rational function in the form
(\ref{GFForm}), and let $l_1,l_2,\ldots,l_d\in\Z^n$ be integer
vectors.  These vectors define the \emph{monomial map} $\phi:
\C^n\rightarrow \C^d$ given by
\[\z=(z_1,z_2,\ldots,z_n)\mapsto (\z^{l_1},\z^{l_2},\ldots,\z^{l_d}).\]
If the image of $\phi$ does not lie entirely in the poles of
$f(\x)$, we can define the function $g:\C^n\rightarrow \C$ by
\[g(\z)=f\big(\phi(\z)\big),\]
which is regular at almost every point in $\C^n$. Then $g(\z)$ is
$f(\x)$ specialized at $x_i = \z^{l_i}$.  In particular, if $l_i=0$
for all $i$, then $g(\z)$ is $f(1,1,\ldots,1)$.

\begin{example}
$S$ is a finite set. \end{example} Then $f(S;1,1,\ldots,1)=\abs{S}$.
\boxend

We have the following theorem, which states that, given $f(\x)$ as a
short rational generating function, we can find $g(\z)$ quickly.

\begin{theorem}\label{MonomialSub} (Theorem 2.6 of \cite{BW03})
Let us fix $k$, an upper bound on the $k_i$ in (\ref{GFForm}).  Then
there exists a polynomial time algorithm, which, given $f(\x)$ in
the form (\ref{GFForm}) and a monomial map
$\phi:\C^n\rightarrow\C^d$ such that the image of $\phi$ does not
lie entirely in the poles of $f(\x)$, computes
$g(\z)=f\big(\phi(\z)\big)$ in the form
\[g(\z)=\sum_{i\in
I'}\beta_i\frac{\z^{q_i}}{(1-\z^{b_{i1}})(1-\z^{b_{i2}})\cdots(1-\z^{b_{is}})},\]
where $s\le k$, $\beta_i\in\Q$, $q_i,b_{ij}\in\Z^n$, and $b_{ij}\ne
0$ for all $i,j$.
\end{theorem}

\ \\

Now let $g_1(\x)$ and $g_2(\x)$ be Laurent power series given by
\[g_1(\x)=\sum_{m\in\Z^d}\alpha_m\x^m \text{ and }
g_2(\x)=\sum_{m\in\Z^d}\beta_m\x^m.\] Then the Hadamard product
$g=g_1\star g_2$ is defined to be the power series
\[g(\x)=\sum_{m\in\Z^d}\alpha_m\beta_m\x^m.\]

\begin{example} $S_1,S_2$ are subsets of $Z^d$,
\[g_1(\x)=\sum_{m\in S_1}\x^m \text{, and }g_2(\x)=\sum_{m\in S_2}\x^m.\]
\end{example}
Then
\[(g_1\star g_2)(\x)=\sum_{m\in S_1\cap S_2}\x^m.\]
\boxend

More generally, we may take the Hadamard product with respect to a
proper subset of the variables, by defining
\[g_1(\y,\z)\star_z g_2(\y,\z)\]
as above, except with $\alpha_m$ and $\beta_m$ functions of $\y$. We
have the following theorem (which is a slightly more general version
of Lemma 3.4 of \cite{BW03}, but the proof is the same).

\begin{theorem}
\label{LemmaHad} Fix $k$, $d_1$, and $d_2$. Let $\y\in\C^{d_1},
\z\in\C^{d_2}$, and $\x=(\y,\z)$. Then there exists a polynomial
time algorithm which, given $l\in\Z^{d_1+d_2}$ and functions
\begin{align*}
g_1(\x)&=\sum_{i\in I_1}\alpha_i\frac{\x^{p_i}}{(1-\x^{a_{i1}})\cdots(1-\x^{a_{ik}})} \text{ and}\\
g_2(\x)&=\sum_{i\in
I_2}\beta_i\frac{\x^{q_i}}{(1-\x^{b_{i1}})\cdots(1-\x^{b_{ik}})}
\end{align*} such that $\langle l,a_i\rangle, \langle l,b_i\rangle
\ne 0$, computes $g=g_1\star_z g_2$ (where the Laurent power series
are convergent on a neighborhood of
$(e^{l_1},e^{l_2},\ldots,e^{l_d})$).
\end{theorem}

\ \\

Note that $l$ in the input of the algorithm is important.  For
example, if $f(x)=\frac{1}{1-x}$, then $f$ has two possible Laurent
power series expansions
\[f(x)=1+x+x^2+\cdots \text{ and }
f(x)=-x^{-1}-x^{-2}-x^{-3}-\cdots\] convergent on $\abs{x}<1$ and
$\abs{x}>1$, respectively.  In this paper, however, the power series
we examine will actually be Laurent polynomials (which are
convergent on all of $\C^d$), so we will not have to worry about
$l$.

We present one final generating function tool.

\begin{lemma}
\label{DecideEqual} Fix $d$ and $k$.  There is a polynomial time
algorithm which, given rational generating functions $g_1(\x)$ and
$g_2(\x)$ in the form (\ref{GFForm}) which are known to be Laurent
polynomials, decides whether $g_1\equiv g_2$.
\end{lemma}

\emph{Remark: }The lemma is also true if $g_1(\x)$ and $g_2(x)$ are
Laurent power series with an infinite number of terms, but there are
several complications which will be noted in the proof.

{\bf Proof: }Let $h(\x)=g_1(\x)-g_2(\x)$.  We want to decide whether
$h\equiv 0$. Suppose that
\[h(\x)=\sum_{a\in\Z^d}c_a\x^a,\]
and let
\[\tilde{h}(\x)=h(\x)\star h(\x)=\sum_{a\in\Z^d}c^2_a\x^a.\]
We can compute $\tilde{h}$ in polynomial time, using Theorem
\ref{LemmaHad}.  Then $h\equiv 0$ if and only if $\tilde{h}\equiv
0$. Since we know that $h$ is a polynomial, we must simply check
whether $\tilde{h}(1)=\sum_{a\in\Z^d}c^2_a$ is zero, which we can do
in polynomial time using Theorem \ref{MonomialSub}.  If we did not
know that $h$ is polynomial, we would have to be a little more
careful, and here is a sketch of what to do. We can find bounds $M$
such that if $c_a=0$ for all $a$ with $\norm{a}_{\infty}\le M$, then
$h$ is identically zero, using, for example, ideas from Section 5.1
of \cite{WoodsThesis04}. Then if we take the Hadamard product
\[\bar{h}=\tilde{h}\star\left(\frac{x_1^{-M}-x_1^{M+1}}{1-x_1}
\frac{x_2^{-M}-x_2^{M+1}}{1-x_2}\cdots\frac{x_d^{-M}-x_d^{M+1}}{1-x_d}\right),\]
we now have something which is known to be a Laurent polynomial, and
$h$ is identically zero if and only if $\bar{h}(1)=0$. \boxend

\section{Computing the generating function}
{\bf Proof of Proposition \ref{QPGF}: } Computing, say, $f_0(t)$
alone would be easy, by interpolation.  Indeed, first define
\[g_0(s)=f_0(s\D).\]
We may find $g_0(0), g_0(1),\ldots, g_0(d)$ in polynomial time,
using Theorem \ref{BarvPolyhedron}, and then interpolate, as
follows. Let $V$ be the $(d+1)\times (d+1)$ Vandermonde matrix whose
$i,j$ entry is $(i-1)^{j-1}$ as $1\le i,j \le d+1$.  Then, if
$g_0(s)=a_0+a_1s+a_2s^2+\cdots+a_ds^d$, we have the following
equation:
\[V\cdot\begin{bmatrix}a_0 \\ \vdots \\ a_d\end{bmatrix}=\begin{bmatrix}g_0(0)\\ \vdots \\ g_0(d)\end{bmatrix}.\]
Multiplying by the inverse of $V$, we get the coefficients of
$g_0(s)$, and can then easily recover the coefficients of $f_0(t)$.

We cannot, however, do this for each $f_i(t)$, sequentially, in
polynomial time: there are $\D$ of them, and $\D$ may be exponential
in the input size. Instead, we perform all $\D$ interpolations
simultaneously, using generating functions.

For $0\le i\le \D-1$, let
\[g_i(s)=f\left(s\D+i\right).\]
For $0\le j\le d$, let
\[h_j(z)=g_0(j)+g_1(j)z+g_2(j)z^2+\cdots+g_{\D-1}(j)z^{\D-1}.\]
For $0\le i\le \D-1$ and $0\le k\le d$, let $a_{ik}$ be such that
\[g_i(s)=a_{i0}+a_{i1}s+a_{i2}s^2+\cdots+a_{id}s^d,\]
 and let
\[a_k(z)=a_{0k}+a_{1k}z+a_{2k}z^2+\cdots+a_{\D-1,k}z^{\D-1}.\]
Then we have that
\[V\cdot\begin{bmatrix}a_0(z)\\ \vdots \\ a_d(z)\end{bmatrix}=\begin{bmatrix}h_0(z)\\ \vdots \\ h_{d}(z)\end{bmatrix}.\]
Therefore, if we can compute each $h_j(z)$ in polynomial time as
short rational generating functions, then we could compute the
$a_k(z)$ as short rational generating functions by multiplying by
the inverse of $V$.

We compute
\begin{align*}
h_j(z)&=g_0(j)+g_1(j)z+g_2(j)z^2+\cdots+g_{\D-1}(j)z^{\D-1}\\
&=f_0(j\D)+f_1(j\D+1)z+f_2(j\D+2)+\cdots+f_{\D-1}(j\D+\D-1)z^{\D-1}\\
&=i_P(j\D)+i_P(j\D+1)z+i_P(j\D+2)z^2+\cdots+i_P(j\D+\D-1)z^{\D-1},
\end{align*}
as follows.  Given $j$, define the polyhedron
\[Q_j=\big\{(z,\y):\ 0\le z\le \D-1 \text{ and }y\in(j\D+z)P\big\}.\]
Then
\[f(Q_j;z,\y)=\sum_{0\le a\le \D-1}z^a\sum_{b\in (j\D+a)P}y^b,\]
and
\[h_j(z)=f(Q_j;z,1).\]
We may compute $f(Q_j;z,\y)$ in polynomial time, using Theorem
\ref{BarvPolyhedron}, and then perform the substitution $\y=1$,
using Theorem \ref{MonomialSub}.

We have shown that we can construct the generating functions
$a_k(z)$, for $1\le k\le d$, in polynomial time.  We must now use
these generating functions to compute
\[F_P(t,z)=f_0(t)+f_1(t)z+\cdots+f_{\D-1}(t)z^{\D-1}.\]

Since, for $0\le j \le \D-1$,
\[g_j(s)=a_{j0}+a_{j1}s+\cdots+a_{jd}s^d\]
and
\[f_j(t)=g_j\left(\frac{t-j}{\D}\right),\]
we have that
\[f_j(t)=a_{j0}+a_{j1}\frac{t-j}{\D}+\cdots+a_{jd}\left(\frac{t-j}{\D}\right)^d\]
and
\[F_P(t,z)=\left\{\begin{array}{cccccccc}
 &a_{00}&+&a_{01}\frac{t}{\D}&+&\cdots&+&a_{0d}\left(\frac{t}{\D}\right)^d\\
+&a_{10}z&+&a_{11}\frac{t-1}{\D}z&+&\cdots&+&a_{1d}\left(\frac{t-1}{\D}\right)^dz\\
 &\vdots & & \vdots& & & & \vdots\\
+&a_{\D-1,0}z^{\D-1}&+&a_{\D-1,1}\frac{t-\D+1}{\D}z^{\D-1}&+&\cdots&+&a_{\D-1,d}\left(\frac{t-\D+1}{\D}\right)^dz^{\D-1}
\end{array}\right. .
\]

For $0\le k \le d$, define
\[b_k(t,z)=a_{0k}\left(\frac{t}{\D}\right)^k+a_{1k}\left(\frac{t-1}{\D}\right)^kz+\cdots+a_{\D-1,k}\left(\frac{t-\D+1}{\D}\right)^kz^{\D-1}.\]
Then
\[F_P(t,z)=b_0(t,z)+b_1(t,z)+\cdots+b_d(t,z).\]
For each $k$, we will compute $b_k(t,z)$ from
\[a_k(z)=a_{0k}+a_{1k}z+a_{2k}z^2+\cdots+a_{\D-1,k}z^{\D-1}.\]
In fact
\[b_k(t,z)=a_k(z)\star_z\left[\left(\frac{t}{\D}\right)^k+\left(\frac{t-1}{\D}\right)^kz+\cdots+\left(\frac{t-\D+1}{\D}\right)^kz^{\D-1}\right],\]
and
\[\left(\frac{t}{\D}\right)^k+\left(\frac{t-1}{\D}\right)^kz+\cdots+\left(\frac{t-\D+1}{\D}\right)^kz^{\D-1}\]
can be computed as a short rational generating function in
polynomial time, by expanding all of the terms and repeatedly using
the fact that, for any $k$, $\sum_{i=1}^{\infty}i^kz^i$ is
$\left(z\frac{d}{dz}\right)^k\left(\frac{1}{1-z}\right)$. Therefore
we can compute the $b_k(t,z)$ and hence $F_P(t,z)$ in polynomial
time. \boxend

\section{Deciding whether $n$ is a period}
{\bf Proof of Theorem \ref{PeriodCheck}: } Given $n$ and $P$, we
want to decide whether $n$ is a period of the quasi-polynomial
$i_P(t)$.  Using Proposition \ref{QPGF}, we may compute the
generating function
\[F_P(t,z)=f_0(t)+f_1(t)z+\cdots+f_{\D-1}(t)z^{\D-1}.\]
Define the generating function
\[G_{n,P}(t,z)=f_n(t)+f_{n+1}(t)z+\cdots+f_{\D-1}(t)z^{\D-n-1}+f_0(t)z^{\D-n}+f_1(t)z^{\D-n+1}+\cdots+f_{n-1}(t)z^{\D-1}.\]
Then $n$ is a period of $i_P(t)$ if and only if $F_P(t,z)\equiv
G_{n,p}(t,z)$.  We must show how to compute $G_{n,P}$ in polynomial
time.  Note that
\begin{align*}F_P(t,z)\star_z \left(\frac{z^n-z^{\D}}{1-z}\right)&=F_P(t,z)\star_z \left(z^n+z^{n+1}+\cdots+z^{\D-1}\right)\\
&=f_n(t)z^n+f_{n+1}(t)z^{n+1}+\cdots+f_{\D-1}(t)z^{\D-1}
\end{align*}
and
\begin{align*}F_P(t,z)\star_z \left(\frac{1-z^{n}}{1-z}\right)&=F_P(t,z)\star_z \left(1+z+\cdots+z^{n-1}\right)\\
&=f_0(t)+f_{1}(t)z+\cdots+f_{n-1}(t)z^{n-1}.
\end{align*}
Then
\[G_{n,P}(t,z)=\left[F_P(t,z)\star_z \left(\frac{z^n-z^{\D}}{1-z}\right)\right]z^{-n}+\left[F_P(t,z)\star_z \left(\frac{1-z^{n}}{1-z}\right)\right]z^{\D-n}.\]
This can be computed in polynomial time, using Theorem
\ref{LemmaHad}.

We can decide whether $F_P(t,z)\equiv G_{n,p}(t,z)$ using Lemma
\ref{DecideEqual}, in polynomial time, and the proof follows.
\boxend

{\bf Proof of Corollary \ref{Reduction}: } Compute $\D=\D(P)$ by
taking the least common multiple of the denominators of all of the
coordinates of the vertices of $P$.  Assume that we can find the
prime factorization of $\D$ using an oracle.  Initialize the
following loop with $n_0:=\D$.
\begin{enumerate}
    \item After the $j$th iteration of the loop, $n_j$ is known to
    be a period of $i_P(t)$.
    \item For each prime factor $p$ of $n_j$, decide whether
    $\frac{n_j}{p}$ is a period of $i_P(t)$.
    \begin{itemize}
        \item If none are periods, then $n_j$ is the minimum period
        of $i_P(t)$, and we are done.
        \item if $\frac{n_j}{p}$ is a period of $i_P(t)$ for some
        $p$, then repeat the process with $n_{j+1}=\frac{n_j}{p}$.
    \end{itemize}
\end{enumerate}
This loop must terminate, because eventually we would have $n_j=1$.
\boxend

\section*{Acknowledgements}
Many thanks to Matthias Beck for helpful conversations.  These
results were originally presented at the Mathematisches
Forschungsinstitut Oberwolfach mini-workshop
``Ehrhart-Quasipolynomials: Algebra, Combinatorics, and Geometry.''

\providecommand{\bysame}{\leavevmode\hbox
to3em{\hrulefill}\thinspace}
\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }
\providecommand{\MRhref}[2]{%
  \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}
} \providecommand{\href}[2]{#2}