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

Several spectral features shuch as Doppler boosting, gravitational redshift and light bending are accounted for in the X--ray\ emission reprocessed by the innermost regions of the accretion disc, which are in a strong gravity regime due to its proximity to the supermassive black hole (SMBH). In this context, both the black hole spin and the disc properties shape the K$\alpha$ emission line profile \citep[see e.g.][]{Reynolds03}.
However, there is some controversy on this interpretation: the partial covering scenario supported by \cite{Turner07} claims that such spectral features can be explained by calling upon a variable wind composed by several ionised clouds that partially cover the X--ray\ continuum source.
Within this paper we argue that the ultimate test to prove the detectability of general relativistic effects under extreme gravity conditions could be furnished by X--ray\ spectroscopy of AGN, which would definitely rule out the partial covering scenario.

On the side of special relativistic effects, Doppler boosting would have a clear and distinct effect on the reflected component: the emission from the parts of the disc approaching towards us would be enhanced while we would detect diminished flux from the receding parts. Due to the fact that the central engine is unresolved,
the only way to distinguish the reflection from the various parts of the disc is by means of the obscuration of the different emitting regions by structures in our line of sight (LOS).
Occultation of the X--ray\ source by optically thick matter was first proposed by \cite{mckernan98}.
A method to investigate relativistic effects during X--ray\ eclipses in AGN spectra was developed by \cite{risaliti2011relat}, consisting on measuring the emission from half of the disc while the other half is covered, and viceversa. Relativistic effects arise when the emission of each half are different, hinting an asymmetric emission from the disc due to Doppler boosting.

Occultation events are rather common in AGN.
These objects show X--ray\ spectral variability on a variety of time--scales,
independently of their luminosity or morphology,
\citep[see e.g. ][]{marshall81}.
Specifically, Narrow Line Seyfert\,1 (NLS1)
galaxies systematically show a higher amplitude variability
\citep{leighly99_nls1}.
Also, variability can occur at time--scales as short as a few hours in all types of AGN, as shown by
\cite{elvis2004} in NGC\,4388 (type\,2),
\cite{bianchi2009} in NGC\,7582 (type\,2),
\cite{Risaliti09} and \cite{maiolino10} in NGC\,1365 (Seyfert\,1.8),
\cite{puccetti2007} in NGC\,4151 (Seyfert\,1.5),
\cite{Risaliti11_mrk766} in Mrk\,766 (NLS1) and
\cite{sanfrutos2013} in SWIFT\,J2127.4+5654\ (NLS1).
The high variability characterised in the references above can be explained in the context of rapid column density changes, which are the result of the interception of material located in the BLR of the system to our LOS
\citep[see e.g.][]{miniutti2014}.
Hence, AGN are perfect laboratories to check general relativity (GR) effects by using eclipses to probe the innermost regions of the accretion disc.

\section{The absorption model}
\label{sec:absorption_model}

The geometry that we assume for the system consists of a SMBH, characterised by its mass ($M_{\rm BH}$) and spin parameter (${\rm a^*}$), around which an optically thick but physically thin ionised accretion disc extends from the innermost stable circular orbit (ISCO) to $1000\,r_{\rm g}$.
About the geometry of the system formed by the disc and the X--ray\ source (or the so--called corona), several configurations have been provided in the literature:
the hot and radiatively compact spherical corona with radius between $3$ and $10\,r_{\rm g}$ proposed by \cite{Fabian15};
the slab \citep{rozanska15}
or the patchy \citep{stern95} geometries;
and the jet base interpretation \citep{Wilkins15b},
just to mention some of them. Our goal in this work is only to perform a first exploration of the inner accretion disc obscuration, therefore we do not choose any particular geometry for the corona yet, leaving that point to a more extensive work (Sanfrutos et al.\ in preparation). However, the continuum X--ray\ source has to be located in the vicinity of the SMBH in order to properly illuminate the innermost regions of the accretion disc;
i.e. \ in our approximation we assume that both the primary continuum and the reflection component arise together from every point on the disc.

The eclipsing cloud is assumed to be co--rotating with the disc at a velocity of 3000\,km\,s$^{-1}$ , and therefore to be located much further away ($10^4\,r_{\rm g}$), in the BLR of the system.
Since these kind of obscuration events are more likely to be detected in unobscured sources, we disregard the torus of the Unification models within the framework of this paper.

The model we are using consists of
a power law plus an X--ray\ reflection component arising from the accretion disc, which is represented by the {\small XILLVER} code in {\small{XSPEC}} \citep{Garcia13}.
These two components are multiplied by the {\small KYNCONV} relativistic convolution model from \cite{dovciak2004}, that produces accretion discs spectra in the strong gravity regime, allowing to obscure part of the emission with a circular cloud whose size and position can be determined.
We model the accretion disc to cover at least one half of the sky as seen from the central engine, with a typical ionisation of $\xi^{\rm (disc)} = 100$\,erg\,cm\,s$^{-1}$ and solar abundances. The energy cutoff is frozen to 300\,keV .
The main parameters that can be tuned in the {\small KYNCONV} relativistic convolution model are:
(i) the inclination $\theta$ of the system with respect to our LOS ($0\degr$: face--on, $89\degr$: edge--on);
(ii) the black hole spin ${\rm a}^*$ ($0$: not rotating, $0.998$: maximally rotating);
(iii) the emissivity index ${\rm q}$, giving account of how the disc is illuminated (low: uniform, high: centrally concentrated);
(iv) the cloud position set by the impact parameters $\alpha$ and $\beta$ in units of $r_{\rm g}$ with horizontal position being positive towards the approaching side of the accretion disc and negative towards the receding part, and with zero vertical position of the cloud (i.e.\ $\beta=0$);
and (v) the cloud size in terms of its radius $r$, also in $r_{\rm g}$ units.
The intrinsical physical properties of the obscuring cloud such as its column density $N_{\rm H}^{\rm (cl.)}$ and ionisation log\,$\xi^{\rm (cl.)}$ are set by muliplying the components defined above by the ionised absorption code {\small{ZXIPCF}} \citep{reeves_zxipcf2008}.
We take into consideration the Galactic absorption too, by means of a neutral absorption component.
We choose an intermediate arbitrary value of $N_{\rm H}^{\rm (Gal.)} = 3 \times 10^{21}\,{\rm cm}^{-2}$.

The procedure we perform is the following: for every position of the cloud we compute the flux in the $0.7-10$\,keV\ energy band, then we compute the intrinsic flux in the same band by removing the cloud, and finally we derive the covering fraction (CF) at every position of the cloud all along the eclipse. Any asymmetry in these CF--light curves would be indicative of asymmetries in the emission from the disc, and therefore it would evidence relativistic effects.

\subsection{The Compton--thick neutral absorber}
\label{subsec:cthick}

\begin{figure*}
\begin{center}
\includegraphics[width=\textwidth]{m1_cf_vs_pos_norm_trasp.eps}
\caption{\label{fig:cf_profiles}A bunch of 36 CF--profiles produced by a neutral cloud of column density $N_{\rm H} = 10^{24}$\,cm$^{-2}$ obscuring a disc illuminated with an emissivity index of ${\rm q} = 3$. The black hole spin ranges from 0 on the left column to 0.998 on the right. The cloud size ranges from $1\,r_{\rm g}$ on the upper row up to $30\,r_{\rm g}$ on the lower. We observe the system at $20 \degr$ (dashed line, red online), $40 \degr$ (solid line, green online) and $60 \degr$ (dash--dotted line, blue online) with respect to the disc's normal. See Section\,\ref{subsec:cthick} for a detailed explanation. }
\end{center}
\end{figure*}

Both low column densities and large ionisations are associated with more transparent clouds, and therefore with fainter CFs. Since our goal is to study the shape of the CF--profiles in order to look for asymmetries pointing to relativistic effects, we decided to explore the parameters space of an absorber able to produce noticeable coverings of the flux emitted by the accretion disc. Hence, the parameters of the absorber that we consider are those of an unphysical opaque neutral cloud, i.e.\ $N_{\rm H}^{\rm (cl.)} = 10^{24}$\,cm$^{-2}$ and log\,$\xi^{\rm (cl.)} = -3$. The study of realistic clouds (Compton--thin and Compton--thick up to $5\times 10^{24}$\,cm$^{-2}$, and ionisations of up to log\,$\xi^{\rm (cl.)} = 6$) is beyond the purpose of this paper and will be detailed elsewhere (Sanfrutos et al.\ in preparation).

The illumination profiles of the disc play an important role too: the steeper the emissivity index is, the more centrally concentrated is the corona and the flux is reflected by material within regions closer to the central engine. Therefore, the higher is the emissivity index parameter ${\rm q}$ the deeper is the eclipse and the larger the CF. Below we present results from some CF--profiles computed with an intermediate emissivity index of ${\rm q} = 3$. The CF--profiles are compiled in Fig.\,\ref{fig:cf_profiles}.

The first parameter about which we can establish some conclusions is the inclination of the system, in terms of the angle between the normal to the disc and our LOS. When we observe the system face--on (i.e.\ $0 \degr$), Doppler boosting is undetectable from our point of view: there are no approaching nor receding regions in the disc, since its orbital plane is perpendicular to our LOS. Therefore the CF--profile observed would be symmetric with respect to the position of the black hole. The larger the inclination is, the greater is the Doppler boosting effect, so that the more noticeable is the asymmetry of the CF--profiles, as can be seen in every panel of Fig.\,\ref{fig:cf_profiles}, independently of every other parameter. The CF--profiles during an eclipse in a system at an inclination of $20 \degr$ (near to pole--on) are shown in dashed red lines; at a greater inclination of $40 \degr$ in solid green lines, showing a greater asymmetry; and finally at an inclination of $60 \degr$ in dash--dotted blue lines, when the asymmetry is the largest. We do not show inclinations lower than $20 \degr$ because one would not expect to find BLR clouds at such high latitudes. We do not show inclinations larger than $60 \degr$ either because the torus would make impossible any observation.

The space of parameters was explored for three characteristic values of the spin. On the left column of Fig.\,\ref{fig:cf_profiles} we show the CF--profiles of a Schwarzschild black hole (ISCO = 6\,$r_{\rm g}$). On the column in the middle we show the same for an intermediate Kerr black hole (ISCO = 4.23\,$r_{\rm g}$). On the right column we show the CFs with a maximally rotating Kerr black hole (ISCO = 1.25\,$r_{\rm g}$). In the cases where the cloud size is comparable to the ISCO (upper row in Fig.\,\ref{fig:cf_profiles}, with a cloud radius of 1\,$r_{\rm g}$, and also in the left and even the middle panels in the second row, with a radius of 6\,$r_{\rm g}$), we could measure the ISCO with great precision in a completely new way when the size of the cloud is known, just by measuring the distance between the two maxima in any of those panels. When larger clouds are involved in the eclipse, general relativistic effects are still detectable, as highlights the asymmetry of the characteristic top hat--shaped CF--profiles shown on any of the panels in the third ($r = 15\,r_{\rm g}$) and fourth ($r = 30\,r_{\rm g}$) rows in Fig.\,\ref{fig:cf_profiles}.

It is important to mention that some of the maxima in the CF--profiles shown in Fig.\,\ref{fig:cf_profiles} are beyond the limits of detectability of available instruments (mainly the upper row cases, when the cloud radius is too small). However, most of them still represent interesting cases that we could discern by using current technology.

\section{Spectral analysis}
\label{sec:spectral_analysis}

We focus now on the case of an intermediate Kerr black hole seen at an inclination of $40 \degr$ and obscured by two different clouds: one ($r = 6\,r_{\rm g}$) slightly larger than the ISCO and one slightly smaller ($r = 3\,r_{\rm g}$). We choose a relatively steep emissivity index ${\rm q} = 6$ in order to get a more centrally concentrated emission from the accretion disc, which will allow the occultation event to reach noticeable CFs with small--sized clouds.
Such steep emissivities or even larger were reported in some of the AGN, e.g.\ 1H\,0707-495 \citep{Fabian09} or IRAS13224-3809 \citep{Ponti10}.

In order to check if the existence of such a cloud is physically possible attending to the physical constraints of the X--ray\ source and absorber sizes and the distance between them, we assume that the central SMBH mass is $10^7\,M_{\odot}$, hence its gravitational radius is $r_{\rm g} = 10^{12}$\,cm. With a cloud of column density $N_{\rm H} = 10^{24}$\,cm$^{-2}$, this implies densities of $8 \times 10^{10}$\,cm$^{-3}$ and $1.7 \times 10^{11}$\,cm$^{-3}$ respectively, which are typical values for the clouds in the BLR. Assuming an orbital velocity of $3000$\,km\,s$^{-1}$ , as already mentioned in Section\,\ref{sec:absorption_model}, the cloud would be located at a distance of $10^4\,r_{\rm g} = 10^{16}\,$cm from the SMBH, and would travel the region of our study ($\sim 40\,r_{\rm g}$) in $\sim 133$\,ks, at a velocity of $0.3\,r_{\rm g}$\,ks$^{-1}$.

\subsection{Simulated spectra}
\label{subsec:simulated_spectra}

\begin{figure}
\begin{center}
\includegraphics[width=0.48\textwidth]{AN.eps}
\includegraphics[height=0.48\textwidth,angle=-90]{AN_rc3.eps}
\includegraphics[height=0.48\textwidth,angle=-90]{AN_rc6.eps}
\caption{\label{fig:cf_with_spectra}
Top: CF--profiles produced by a neutral cloud with $N_{\rm H} = 10^{24}$\,cm$^{-2}$. The system's inclination is $40 \degr$. The disc reflection has an emissivity index of ${\rm q} = 6$. The black hole spin is ${\rm a} = 0.5$, producing an ISCO of $4.23\,r_{\rm g}$. The cloud size is $3\,r_{\rm g}$ for the dotted line and $6\,r_{\rm g}$ for the dashed line.
Middle: Simulated spectra during a $3\,r_{\rm g}$--sized cloud eclipse.
Bottom: Simulated spectra during a $6\,r_{\rm g}$--sized cloud eclipse.
The shapes\,/\,colours code is the same for the three panels, and indicates the location of the cloud (top panel) producing each one of the spectra (middle and bottom panels).
The data are rebinned for clarity reasons only.
See Section\,\ref{subsec:simulated_spectra} for a detailed explanation. }
\end{center}
\end{figure}

Next we generate the corresponding CF--profiles for the situation under study, which are shown in the upper panel of Fig.\,\ref{fig:cf_with_spectra}.
Beyond the covering fraction profiles, it is more interesting to determine whether a cloud involved in this kind of eclipses could imprint any effect on the spectra taken all along one obscuration event, and if so, discern if it would be detectable by current or future observatories. To this extent, we perform several 10--ks simulations of spectra as they would be observed with the EPIC-pn instrument on board {\it XMM--Newton}\ during different stages of an eclipse caused by a BLR cloud of $3\,r_{\rm g}$ and $6\,r_{\rm g}$. We show the most characteristic ones in the middle and bottom panels of Fig.\,\ref{fig:cf_with_spectra}.

In both cases, the spectra out of the eclipse (at $20\,r_{\rm g}$) are shown in black X--shaped markers. The maximum absorption occurs when the cloud covers the approaching part of the inner accretion disc, at $5.7\,r_{\rm g}$ in the case of the smallest cloud and at $3.9\,r_{\rm g}$ in the case of the biggest, shown in blue circles. The hard band ($2-10$\,keV) remains unabsorbed during all the event, while the soft band ($0.7-2$\,keV) shows variability. Since the radius of the small cloud is lower than the ISCO, when the cloud is around the $0\,r_{\rm g}$ position in the reference grid with respect to the black hole, it does not cover any flux, hence the spectrum is again unabsorbed (not shown for clarity, but consistent with the black spectrum in the middle panel of Fig.\,\ref{fig:cf_with_spectra}). However, when the cloud is larger than the ISCO, it intercepts flux from both the approaching and the receding parts of the disc, and absorption is still notable (though lower than when the cloud was in the $3.9\,r_{\rm g}$ position), as shown in green squares in the bottom panel of Fig.\,\ref{fig:cf_with_spectra}. When the cloud is over the receding part of the disc ($-5.9\,r_{\rm g}$), absorption enhances as expected in the case of the small cloud, as shown in red triangles in the middle panel of Fig.\,\ref{fig:cf_with_spectra}, although not as much as when the approaching part was eclipsed. In the case of the biggest cloud, when it occupies the same position absorption does not enhance since the cloud is larger than the ISCO and covers part of the inner accretion disc all the time.
Finally, as the cloud goes away the spectra recover their initial flux values at all energy ranges (not shown for clarity reasons, but consistent with the black spectra). From this analysis, specifically of the small cloud transit, we conclude that even though the CF is low, both eclipses are deep enough to be detected spectroscopically.

\subsection{Model--independent H\,/\,S light curves}
\label{subsec:HS}

\begin{figure}
\begin{center}
\includegraphics[width=0.4\textwidth]{_ratiohs_time_AN.eps}
\caption{\label{fig:hs}
H\,/\,S light curves produced by the same clouds as in Fig.\,\ref{fig:cf_with_spectra}.
Hard band: 2--10\,keV .
Soft band: 0.7--2\,keV .
The circles represent the net hardness ratios computed from the count rates of the simulated spectra. The cloud radius is $3\,r_{\rm g}$ for the small red marks, while it is $6\,r_{\rm g}$ for the large green ones. The model--predicted ratios are shown as dotted and dashed lines for the small and large clouds respectively. See Section\,\ref{subsec:HS}. }
\end{center}
\end{figure}

It is even more interesting to compare the different behaviour between the soft and the hard bands: while the clouds are transparent to hard photons, part of the soft ones are absorbed. Therefore these kind of obscuration events drive absorption variability in the soft X--ray\ band. With the aim of better understanding how this effect takes place, we simulate the H\,/\,S ratios too. The process is as follows: from the spectra generated in Section\,\ref{subsec:simulated_spectra} we compute the count rates within the hard band in the $2-10$\,keV\ range, and also in the soft band in the $0.7-2$\,keV\ range, and then we compute the H\,/\,S ratio light curve of each observation simply by computing the fraction of the hard band over the soft one.
The light curves are shown in Fig.\,\ref{fig:hs}, in terms of the net count rates computed from the simulated spectra (red small circles for the $3\,r_{\rm g}$--sized cloud, green large circles for the $6\,r_{\rm g}$--sized cloud), together with the model--predicted count rates (dotted and dashed lines respectively).
The advantage of this technique is that the eclipse can be identified and characterised just computing the total count rates in different bands of each one of the spectra, in a completely model--independent way. By comparing Fig.\,\ref{fig:cf_with_spectra} and Fig.\,\ref{fig:hs}, we conclude that an obscuration event is associated with the existence of high H\,/\,S ratio regions in the light curves. In addition, the H\,/\,S light curves and the CF profiles share the same shape, so that the eclipse parameters could be measured in a model--independent way studying the H\,/\,S ratio of several short spectra all along one observation.
As an example, from the $3\,r_{\rm g}$ CF--profile in Fig.\,\ref{fig:cf_with_spectra}, we find the distance between the two maxima to be $11.6\pm0.1\,r_{\rm g}$, which corresponds with a time interval of $38.7\pm0.5$\,ks for a cloud moving at 3000\,km\,s$^{-1}$ . From the $3\,r_{\rm g}$ H\,/\,S light curve we find this interval to be $40 \pm 7$\,ks for the same cloud, which is consistent with the value computed from the model--dependent CFs.
Designing a finer--scale sampling is not possible for the chosen set of parameters, but it would not be an issue to do it for a system with a slower cloud or a larger black hole mass. We let the study of such systems for a more exhaustive future paper (Sanfrutos et al.\ in preparation).

\section{Discussion}
\label{sec:discussion}

We have shown some promising preliminar results.
In Section\,\ref{sec:absorption_model} we defined a model for the continuum X--ray\ emission plus the reflection component convolved with the relativistic kernel {\small KYNCONV} \citep{dovciak2004}, giving account of GR effects due to the proximity of the material in the inner accretion disc to the SMBH. The eclipse of these regions by a Compton--thick neutral cloud produces peculiar CF--profiles depending on the inclination of the system, on the black hole spin and emissivity index, and on the size of the absorber. The study of such profiles allows us to discern how much flux is emitted from every region within the disc. This way we find that the emission measured from our point of view is anisotropic: it is much larger from the parts of the disc that are running towards us in their orbital motion around the SMBH than from its receding parts. This is an effect of Doppler boosting, and its detection would definitely prove that GR effects imprint the AGN X--ray\ spectra. We may have already detected these disc emission anisotropies during some of these BLR clouds eclipses, since the shapes of the CF--profiles shown in Fig.\,\ref{fig:cf_profiles} are remarkably similar to those shown in Fig.\,6 in \cite{Risaliti09} and Fig.\,6 in \cite{sanfrutos2013}. This encourages us to deepen the study of these relativistic effects by fitting simulated and real spectra, with the caveat of the detectability limit.

In Section\,\ref{subsec:simulated_spectra} we explored the detectability of GR effects in a set of simulated X--ray\ spectra along one occultation event, finding that (i) a Compton-thick ($N_{\rm H} = 10^{24}$\,cm$^{-2}$) neutral cloud is transparent to hard X--ray s ($2-10$\,keV), but produces absorption in the soft band ($0.7-2$\,keV); and that (ii) the maximum absorption occurs when the cloud intercepts our LOS to the approaching part of the accretion disc, as expected due to Doppler boosting.
The difference in absorption between the hard and the soft bands led us to study the H\,/\,S ratio light curves produced during an eclipse. In Section\,\ref{subsec:HS} we showed that the behaviour of the H\,/\,S light curves follows that of the CF--profiles, hence we concluded that it is possible to characterise the properties of the innermost regions of the accretion disc in a new model--independent way just by computing the count rates of the hard and soft bands of spectra taken all along an eclipse.

Only {\it XMM--Newton}\ simulations were studied at the moment. In a forthcoming work (Sanfrutos et al.\ in preparation) we will fit real {\it XMM--Newton}\ data and will also simulate spectra from other instruments. In this context we will study the effect of eclipses produced by thicker and\,/\,or ionised clouds in harder bands by means of {\it NuSTAR}. We will also perform simulations of spectroscopic data from {\it Athena}, considering more complex models giving account of resolved spectral absorption lines \citep[{\small PHASE} code by][]{krongold_phase2003} in order to take advantage of the outstanding spectral resolution of the future X--ray\ observatory.

Finally, among the technical issues to take into account, it will be important to refine any possible degeneracies among the parameters, to study spectra in several bands of interest in the {\it XMM--Newton}\ archive, and to study variations in the soft excess band, where the sensitivity of our instruments gets its highest.

Financial support for this work was provided by the European Union through the Seventh Framework Programme (FP7/2007--2013) under grant n. 312789.
MS thanks CSIC for support through a JAE--Predoc grant, and rejects cuts to public science budget.

\bibliographystyle{aa}


\section*{Introduction}

Let $(R,\mathfrak{m})$ be a commutative Noetherian local ring of dimension $d$ containing a field $K$ of positive characteristic $p$.
For an ideal $I$ and a prime power $q=p^e$ we define the ideal $I^{[q]}=\langle a^q|a\in I\rangle$ which is the ideal generated by the $q$th power of the elements of $I$.
Let $I$ be an $\mathfrak{m}$-primary ideal of $R$ and $M$ a finite $R$-module. Then the $R$-modules $M/I^{[q]}M$ have finite length. The \emph{Hilbert-Kunz function} of $M$ with respect to $I$ is
\[ HKF(I,M)(q)=\operatorname{length}(M/I^{[q]}M). \]
If $M=R,I=\mathfrak{m}$ then we have the classical Hilbert-Kunz function $HKF(\mathfrak{m},R)(q)=HK_R(q)$, introduced by Kunz \cite{Kunz}. He showed that $R$ is regular if and only if $HK_R(q)=q^d$ for all $q$.
In \cite{Monsky}, P. Monsky proved that there is a real constant $c(M)$ such that
\[\operatorname{length}(M/I^{[q]}M)=c(M)q^d+O(q^{d-1}).\]
The \emph{Hilbert-Kunz multiplicity} $e_{HK}(I,M)$ of $M$ with respect to $I$ is
\[e_{HK}(I,M):=\lim_{q\rightarrow\infty}\dfrac{\operatorname{length}(M/I^{[q]}M)}{q^d}. \]
There are many questions related to Hilbert-Kunz function and multiplicity.
\begin{inproblem}
Is the Hilbert-Kunz multiplicity always a rational number?
\end{inproblem}
\begin{inproblem}
Is there any interpretation in characteristic 0?
\end{inproblem}
For the following problems the ring comes from a finitely generated $\mathbb Z$-algebra by reduction modulo $p$.
\begin{inproblem}
How does the Hilbert-Kunz multiplicity depend on the characteristic $p$?
\end{inproblem}
\begin{inproblem}
Does the limit
\[\lim_{p\rightarrow\infty} e_{HK}(I_p,R_p) \] exist?
\end{inproblem}
\begin{inproblem}[C.Miller]
Does the limit
\[ \lim_{p\rightarrow \infty} \dfrac{\operatorname{length}(R_p/I_p^{[p]})}{p^d}\]
exist?
\end{inproblem}
In most known cases the Hilbert-Kunz multiplicity is a rational number, for example for toric rings (\cite{Watanabe}, \cite{Bruns}), monoid rings (\cite{Eto}),
monomial ideals and binomial hypersurfaces (\cite{Conca}), rings of finite Cohen-Macaulay type (\cite{Seibert}), for invariant rings for the action of a finite group on a polynomial ring (follows from \cite[Theorem 2.7]{Watanabeyoshida}), for
two-dimensional graded rings (\cite{Bre06}, \cite{Trivedi2}).
In \cite{Brenner} it is shown that there exist also irrational Hilbert-Kunz multiplicities.

There are many situations where the Hilbert-Kunz multiplicity is independent of the characteristic $p$.
For example, for toric rings (\cite{Watanabe}) or invariant rings as above the Hilbert-Kunz multiplicity is independent of the characteristic of the base field at
least for almost all prime characteristics. But there are also examples where the Hilbert-Kunz multiplicity depends on the characteristic.

We can ask when the limit of the Hilbert-Kunz multiplicity exists for $p\rightarrow\infty$. If so then this limit is a
candidate for the Hilbert-Kunz multiplicity in characteristic zero. This  leads us to the question of whether a characteristic zero Hilbert-Kunz multiplicity could be defined directly. In all known cases this limit exists.
H. Brenner, J. Li and C. Miller (\cite{BreLiMil}) have observed that in all known cases where
\[\lim_{p\rightarrow\infty}e_{HK}(R_p)\]
exists then this double limit can be replaced by the limit of Problem 5.

If the rings are of a more combinatorial nature, like for example monoid rings (\cite{Eto}, \cite{Watanabe}, \cite{Bruns}), Stanley-Reisner rings and binomial hypersurfaces (\cite{Conca}), we have positive answers for all these problems.
Also, the proofs in these cases are easier compared to the methods of P. Monsky, C. Han, P. Teixeira (\cite{MonHan}, \cite{MonTei04}, \cite{MonTei06}) or the geometric methods of H. Brenner and V. Trivedi (\cite{Bre06}, \cite{Bre07}, \cite{TriFak03}, \cite{Trivedi1}, \cite{Trivedi2}, \cite{Trivedi07}).
We want to generalize these results to a broad and unified concept of a combinatorial ring. For that we work with a new combinatorial structure namely binoids (pointed monoid) which were introduced in the thesis of S. Boettger \cite{Simone}.
A binoid $(N,+,0,\infty)$ is a monoid with an absorbing element $\infty$ which means that for every $a\in N$ we have $a+\infty=\infty+a=\infty$.
This concept recovers among others monoid rings and Stanley-Reisner rings.

In the first four sections we will describe some basic properties of binoids and related objects,
namely $N$-sets, smash products, exact sequences. Also we will give the definition and some properties on the dimension of binoids and their binoid algebras.
In Section 5 we will define the Hilbert-Kunz function and multiplicity of binoids. This function is given by counting the elements in certain residue class binoids,
and not the vector space dimension (or length) of residue class rings. We define the Hilbert-Kunz function and Hilbert-Kunz multiplicity not only for binoids but also for $N_+$-primary ideals of $N$ and a finitely generated $N$-set in the following way:

Let $N$ be a finitely generated, semipositive binoid, $T$ a finitely generated $N$-set and $\mathfrak{n}$ an $N_+$-primary ideal of $N$. Then we call the number
\[\hkf^N(\mathfrak{n},T,q)=\hkf(\mathfrak{n},T,q):=\# T/([q]\mathfrak{n}+T)\]
(where for a finite binoid we do not count $\infty$) the Hilbert-Kunz function of $\mathfrak{n}$ on the $N$-set $T$ at $q$. In particular, for $T=N$ and $\mathfrak{n}=N_+$ we have
\[ \hkf(N,q):=\hkf(N_+,N,q)=\#N/[q]N_+. \]
Note that this function is defined for all $q\in\mathbb N$, not only for powers of a fixed prime number. Also note that this residue construction is possible in the category of binoids, not in the category of monoids. The combinatorial Hilbert-Kunz multiplicity is the limit of this function divided by $q^{\dim N}$, provided this limit exists and provided that there is a reasonable notion of dimension.

It turns out that the Hilbert-Kunz function of a binoid for $q=p^e$ is the same as the Hilbert-Kunz function of its binoid algebra over a field of characteristic $p$.
Hence from here we have a chance to study the above mentioned five problems, by just studying the binoid case.

Since the Hilbert-Kunz function of binoids is given by just counting elements, not vector space dimensions,
this reveals clearer the combinatorial nature of the problem.
For example we have
\[\dim_K K[N]/K[N_+]^{[q]}=\dim_K K[N/[q]N_+]=\# N/[q]N_+.  \]
So the computation of the Hilbert-Kunz function and multiplicity of a binoid is in some sense easier than the standard Hilbert-Kunz function and multiplicity.
The following is our main combinatorial theorem (Theorem \ref{f.g,s.p,c,r binoid}).

\begin{intheorem}
Let $N$ be a finitely generated, semipositive, cancellative, reduced binoid and $\mathfrak{n}$ be an $N_+$-primary ideal of $N$.
Then $e_{HK}(\mathfrak{n},N)$ exists and is a rational number.
\end{intheorem}

Note that this is a characteristic-free statement and that the existence does not follow from Monsky's theorem.
From this result we can deduce a positive answers to our five problems, see Theorem \ref{Miller conjecture} and Theorem \ref{existsrational} in the current setting.

The strategy to prove these theorems is to reduce it step by step to the corresponding results of lower dimensional binoids fulfilling further properties.
The case of primary ideals in a normal toric setting was given by Eto, Bruns, Watanabe and is true without normality. The components of a reduced torsion-free cancellative binoid are toric, and the Hilbert-Kunz multiplicity depends only on the components of maximal dimension.
In the proof of this we encounter also the non-reduced situation, and for this the (strongly) exact sequences of $N$-sets are extremely useful. The reduction from the case
with torsion to the torsion-free case requires a deeper understanding of the torsion-freefication and its relation to the smash product of the torsion-free binoid and a
finite group. In this setting we need to replace positive (local algebras) by semipositive (corresponding to semilocal algebras), so we also have to generalize the Hilbert-Kunz theory on the ring side.

\section{Binoids and their properties}

In this Section we will introduce (commutative) binoids, describe basic properties of binoids and binoid sets and their properties.
For a general introduction to binoids we refer to \cite{Simone}, where most of the basic concepts were developed.
We focus on material which is relevant for Hilbert-Kunz theory.

A \emph{binoid} $(N,+,0,\infty)$ is a commutative monoid with an absorbing element $\infty$, given by the property $x +\infty= \infty$.
We write $N^\bullet$ for the set $N\setminus \{\infty\}$. If  $N^\bullet$ is a monoid, then $N$ is called an \emph{integral} binoid. The set of all units form the \emph{unit group} of $N$, denoted by $N^\times$.
The set of all non-units $N\setminus N^\times$ will be denoted by $N_+$. A binoid $N \neq \{ \infty\}$ is called \emph{semipositive}, if $|N^\times|$ is finite
and \emph{positive}, if $N^\times=\{0\}$. From the corresponding concepts in monoid theory it is clear what a homomorphism of binoids (sending $\infty$ to $\infty$),
what the kernel is and what an ideal, a radical, a prime ideal is. Specific for an ideal $I \subseteq N$ in a binoid is that there is a homomorphism $M \rightarrow M/I$
to the \emph{residue class binoid}, where the ideal is sent to $\infty$ and which is injective elsewhere.

For every ideal $I$ and $q \in \mathbb N_+$ we will denote by
\[ [q]I :=\langle q a\mid a\in I\rangle \]
the ideal generated by the set $\{qa\mid a\in I\}$, which we call the $q$th \emph{Frobenius sum} of the ideal.

For a binoid homomorphism $\varphi: N\rightarrow M$ and an ideal $I\subseteq N$ we denote by $I+M$ the ideal generated by $\varphi(I)$
and call it the \emph{extended ideal}. Since $[q]:N\rightarrow N, x\mapsto qx$, is a binoid homomorphism, the ideal $[q]I$ can be considered as
the extended ideal under this homomorphism. The extension of ideals commute with Frobenius sums. An ideal is called a \emph{primary ideal} if $\operatorname{rad}(\mathfrak{n})=N_+$. For an
$N_+$-primary ideal $\mathfrak{n}$ also its Frobenius sums $[q]\mathfrak{n}$ are $N_+$-primary. For a finitely generated semipositive binoid and an $N_+$-primary ideal $\mathfrak{n}$
the residue class binoid $N/\mathfrak{n}$ is a finite set.

An element $a\in N$ is called \emph{nilpotent} if $na=a+\cdots+a=\infty$ for some $n\in\mathbb N$. The set of all nilpotent elements will be denoted by $\operatorname{nil}(N)$.
We say that $N$ is  \emph{reduced} if $\operatorname{nil}(N)=\{\infty\}$. We call the quotient binoid $N_{\operatorname{red}}:=N/\operatorname{nil}(N)$ the \emph{reduction} of $N$.
An element $a \in N$ is a \emph{torsion} element in case $a=\infty$ or $na = nb$ for some $b\in N, b\neq a, n \geqslant 2$.
We say $N$ is \emph{torsion-free} if there are no other torsion elements in M besides $\infty$, i.e. $na = nb$ implies $a = b$ for every $a, b \in N$ and $n\geqslant 1$.
A binoid is called \emph{torsion-free up to nilpotence} if $na = nb \neq \infty$ implies $a = b$ for
every $a, b \in N$ and $n \geqslant 1$.

For an integral binoid $N$ we denote by $\operatorname{diff} N$ the \emph{difference} binoid of $N$, which is a group binoid. If $N$ is integral and cancellative then there is an injection
$N \subseteq \operatorname{diff} N$. If $N \subseteq M \subseteq \operatorname{diff} N$ we say that $M$ is \emph{birational} over $N$.

The \emph{spectrum} of $N$, denoted by $\operatorname{Spec} N$, is the set of all prime ideals of $N$. It can be made to a (finite, if $N$ is finitely generated binoid) topological space.
The \emph{combinatorial dimension} of a binoid $N$, denoted by $\dim N$, is the supremum of the lengths of strictly increasing chains of prime ideals of $N$. Without any further
condition the Krull dimension of a binoid algebra $K[N]$ over a field $K$ and $\dim N$ need not be the same. A binoid algebra is the monoid algebra where one additionally sets $T^\infty =0$.

\begin{lemma}
\label{dimension properties}
Let $N$ be a finitely generated binoid. If $N$ is integral and $I\neq \{\infty\}$ be an ideal of $N$, then $\dim N/I< \dim N$. If $\mathfrak{p}$ and $\mathfrak{q}$ are
different minimal prime ideals of $N$, then $\dim N/(\mathfrak{p}\cup \mathfrak{q})<\min\{\dim N/\mathfrak{p},\dim N/\mathfrak{q}\}$.
\end{lemma}
\begin{proof}
See \cite[Proposition 1.8.3]{Batsukhthesis} and \cite[Proposition 1.8.4]{Batsukhthesis}.
\end{proof}

\section{$N$-sets}

A \emph{pointed set} $(S,p)$ is a set $S$ with a distinguished element $p\in S$. Let $N$ be a binoid.
\begin{definition}
An \emph{operation} of $N$ on a pointed set $(S,p)$ is a map
\[ +:N\times S \longrightarrow S,~~ (n,s)\longmapsto n+s, \]
such that the following conditions are fulfilled:
\begin{enumerate}
  \item For all $n,m\in N$ and $s\in S:(n+m)+s=n+(m+s)$.
  \item For all $s\in S: 0+s=s$.
  \item For all $s\in S: \infty+s=p$.
  \item For all $n\in N: n+p=p$.
\end{enumerate}
Then $S$ is called an $N$-\emph{set}.
\end{definition}

Given a fixed binoid homomorphism $N \rightarrow M$ then $M$ is an $N$-set in a natural way. This applies in particular for $N$ itself and for residue class binoids.
For an $N$-set $(S,p)$ we say that $a\in N$ is an \emph{annihilator} if $a+s=p$ for every $s\in S$. We denote the set of all annihilators by $\operatorname{Ann} S$, which is an ideal of $N$.
The $N$-set $(S,p)$ is also an $(N/\mathfrak{a})$-set for every ideal $\mathfrak{a}\subseteq \operatorname{Ann} S$. If there exist finitely many elements
$s_1,\dots,s_k\in S$ such that for all $s\in S$ we can write $s=n+s_j$ where $n\in N$,
then we say that $S$ is a \emph{finitely generated $N$-set}. We call the elements $s_j$ $N$-\emph{generators}.

For a finite $N$-set $S$ we set
\[\# S=|S|-1=|S\setminus\{p\}| , \]
so we do not count the distinguished point.

For a family of $N$-sets $(S_i,p_i)$, $i\in I$, we define the \emph{pointed union} of $S_i,i\in I,$ by
\[\bigcupdot_{i\in I} S_i=(\biguplus_{i\in I}S_i)/\sim, \]
where $\biguplus$ is the disjoint union and $a\sim b$ if and only if $a=b$ or $a=p_j,~b=p_k$ for some $j,k$.
So the pointed union just contracts the points $p_j$ to one point. We write $S^{\cupdot r}=\bigcupdot_{i=1}^r S$ and in particular
$N^{\cupdot r}$ for the $r$-folded pointed union of $N$ with itself.

For a homomorphism $f:S\rightarrow T$ of $N$-sets we set
\[ \operatorname{im}(f)=\{t\in T \mid t = f(s) \text{ for some } s \in S\} \text{ and } \ker(f)=\{s\in S \mid  f(s)=p_T\}. \]
For an $N$-subset $S\subseteq T$ we define the \emph{quotient} of $T$ by $S$ to be the $N$-set $(T \setminus S) \cup {p}$ and denoted it by $T/S$,
so $S$ is contracted to a point.

The following statements are analogous to statements about modules, for the easy proofs we refer to \cite{Batsukhthesis}.

\begin{lemma}
\label{hom}
Let $N$ be a binoid, $(S,p_S),(T,p_T)$ be $N$-sets and $S'\subseteq S$ an $N$-subset. If we have an $N$-set homomorphism $\phi:S\rightarrow T$ with $\phi(S')=p_T$ then there exists a unique  homomorphism $\tilde{\phi}:S/S'\rightarrow T$ such that the following diagram commutes.

\[\begin{tikzpicture}[node distance=1.8cm, auto]
  \node (S) {$S$};
  \node (T) [right of=S] {$T$};
  \node (A) [below of=S] {$S/S'$};
  \draw[->] (S) to node {$\phi$} (T);
  \draw[->, dashed] (A) to node  [swap]{$\tilde{\phi}$} (T);
  \draw[->] (S) to node [swap] {$\varphi$} (A);
\end{tikzpicture}
\]
If $\phi$ is surjective, then $\tilde{\phi}$ is surjective.
\end{lemma}
\begin{proof}
See \cite[Lemma 1.5.7]{Batsukhthesis}.
\end{proof}

\begin{proposition}
\label{quotient to union}
Let $N$ be a finitely generated binoid, $J$ be an ideal of $N$ and $S\subseteq T$ be $N$-sets. Then $(T/S)/(J+(T/S))= T/(S\cup (J+T))$.
\end{proposition}
\begin{proof}
See \cite[Proposition 1.5.8]{Batsukhthesis}.
\end{proof}

\begin{lemma}
\label{canonical isomorphism}
Let $N$ be a binoid, $I\subseteq N$ an ideal of $N$ and $(T,p)$ be an $N$-set.
If $r$ is some positive integer then we have a canonical $N$-set isomorphism
\[T^{\cupdot r}/(I+T^{\cupdot r})\cong (T/(I+T))^{\cupdot r}. \]
\end{lemma}
\begin{proof}
See \cite[Lemma 1.5.9]{Batsukhthesis}.
\end{proof}

\begin{lemma}
\label{surj hom}
Let $N$ be a binoid, $(S,p_S),(T,p_T)$ $N$-sets and $I\subseteq N$ be an ideal of $N$.
If we have a surjective $N$-set homomorphism $\phi:S\rightarrow T$ then there exists a canonical surjective $N$-set homomorphism
$\tilde{\phi}:S/(I+S)\longrightarrow T/(I+T)$.
\end{lemma}
\begin{proof}
See \cite[Lemma 1.5.10]{Batsukhthesis}.
\end{proof}

\begin{lemma}
\label{surj map for f.g. set}
Let $N$ be a binoid and $T$ be an $N$-set. Then
\begin{enumerate}
\item For $t_1,\dots,t_r\in T$ we can define an $N$-set homomorphism $\phi:N^{\cupdot r}\rightarrow T$.
\item $t_1,\dots,t_r\in T$ is a generating system of $T$ over $N$ if and only if $\phi$ is a surjective homomorphism.
\item $T$ is finitely generated over $N$ if and only if there exists a surjective $N$-set homomorphism $N^{\cupdot r}\rightarrow T$.
\end{enumerate}
\end{lemma}
\begin{proof}
See \cite[Lemma 1.5.11]{Batsukhthesis}.
\end{proof}

The smash product of binoids and $N$-sets correspond to the tensor product of algebras and modules.

\begin{definition}
Let $(S_i,p_i)_{i\in I}$ be a finite family of pointed sets and $\sim_\wedge$ the relation on $\prod_{i\in I} S_i$ given by
\[ (s_i)_{i\in I}\sim_\wedge (t_i)_{i\in I}:\Leftrightarrow s_i=t_i,\text{ for all } i\in I, \text{ or } s_j=p_j,t_k=p_k \text{ for  some } j,k\in I. \]
Then the pointed set
\[\bigwedge_{i\in I}S_i:=(\prod_{i\in I} S_i)/\sim_\wedge \]
with distinguished point $[p_\wedge:=(p_i)_{i\in I}]$ is called the \emph{smash product} of the family $S_i,i\in I$.
\end{definition}
\begin{definition}
Let $N$ be a binoid, $(S_i,p_i)_{i\in I}$ be a finite family of pointed $N$-sets and $\sim_{\wedge_N}$ the equivalence relation on
$\bigwedge_{i\in I} S_i$ generated by
\[ \cdots\wedge n+s_i\wedge \cdots \wedge s_j \wedge\cdots \sim_{\wedge_N}\cdots\wedge s_i\wedge\cdots\wedge n+s_j \wedge\cdots,\] for all $i,j\in I$ and $n\in N$.
Then \[\bigwedge_{i\in I} {\!_N} S_i:=(\bigwedge_{i\in I} S_i)/\sim_{\wedge_N} \]
is called the
\textbf{smash product} of the family $(S_i)_{i\in I}$ over $N$.
\end{definition}

\begin{proposition}
\label{pointed union and smash}
Let $N$ be a binoid and $S$, $T_i,1\leqslant i\leqslant k$ be $N$-sets. Then
\[S\wedge_N (\bigcupdot_{i=1}^k T_i)=\bigcupdot_{i=1}^k (S\wedge_N T_i). \]
\end{proposition}
\begin{proof}
See \cite[Proposition 1.6.7]{Batsukhthesis}.
\end{proof}

\begin{proposition}
\label{quotient}
Let $N$ be a binoid and $(S,p)$ an $N$-set. If $I$ is an ideal of $N$ then
\[(N/I)\wedge_N S\cong S/(I+S).\]
\end{proposition}
\begin{proof}
See \cite[Proposition 1.6.8]{Batsukhthesis}.
\end{proof}

\begin{proposition}
\label{surj map to smash}
Let $N$ be a binoid and $J$ an ideal of $N$. If $S$ is a finitely generated $N$-set then there is a surjective homomorphism
$(N/J)^{\cupdot r}\rightarrow S\wedge_N N/J$, where $r$ is the number of generators of $S$.
\end{proposition}
\begin{proof}
See \cite[Proposition 1.6.9]{Batsukhthesis}.
\end{proof}

\begin{corollary}
\label{quotient over primary ideal and smash}
Let $N$ be a finitely generated, semipositive binoid and $J$ an $N_+$-primary ideal of $N$. If $S$ is a finitely generated $N$-set then $S\wedge_N N/J$ is finite.
\end{corollary}
\begin{proof}
See \cite[Corollary 1.6.10]{Batsukhthesis}.
\end{proof}

\begin{lemma}
\label{smash of quotients}
Let $M,N$ be binoids and $I\subseteq M,J\subseteq N$ be ideals. Then $(I\wedge N)\cup (M\wedge J)$ is an ideal of $M\wedge N$ and
\[(M\wedge N)/((I\wedge N)\cup (M\wedge J))\cong M/I\wedge N/J. \]
\end{lemma}
\begin{proof}
See \cite[Lemma 1.6.13]{Batsukhthesis}.
\end{proof}

\begin{proposition}
\label{number of elements of smash}
Let $N,M$ be finite binoids, then
\[\#(N\wedge M)=\#N\cdot\#M. \]
\end{proposition}
\begin{proof}
See \cite[Proposition 1.6.2]{Batsukhthesis}.
\end{proof}

\begin{theorem}
\label{dimension of smash product}
Let $M,N$ be non zero binoids of finite dimension. Then
\[\dim M \wedge N=\dim M+ \dim N. \]
\end{theorem}
\begin{proof}
See \cite[Theorem 1.8.5]{Batsukhthesis}.
\end{proof}

\section{Exact sequences for $N$-sets}

The concept of (strongly) exact sequences for $N$-sets is crucial to reduce statements on the Hilbert-Kunz function to lower dimensional binoids.

\begin{definition}
Let $N$ be a binoid. A sequence
\[S_0 \xrightarrow{\;\phi_1} S_1 \xrightarrow{\;\phi_2} S_2 \xrightarrow{\;\phi_3}\cdots\xrightarrow{\;\phi_n} S_n \]
of $N$-sets and $N$-set homomorphisms is called \emph{exact} if the image of each homomorphism is equal to the kernel of the next:
\[ \operatorname{im}\phi_k = \ker\phi_{k+1}. \]
\end{definition}
\begin{definition}
Let $N$ be a binoid. An exact sequence
\[S_0 \xrightarrow{\;\phi_1} S_1 \xrightarrow{\;\phi_2} S_2 \xrightarrow{\;\phi_3}\cdots\xrightarrow{\;\phi_n} S_n\]
is called \emph{strongly exact} if $\phi_k$ is injective on $S_{k-1}\setminus \ker \phi_k$ for every $k$.
\end{definition}
\begin{proposition}
\label{exact sequence}
Let $N$ be a binoid, $S\subseteq T$ and $U$ be $N$-sets. Then we have an exact sequence of $N$-sets
 \[\infty\xrightarrow{\;\phi_1} \{s\wedge u\mid s\wedge u=\infty \text{ in } T\wedge_N U\} \xrightarrow{\;\phi_2} S\wedge_N U\xrightarrow{\;\phi_3} T\wedge_N U\xrightarrow{\;\phi_4} (T/S)\wedge_N U\xrightarrow{\;\phi_5}\infty. \]
\end{proposition}
\begin{proof}
We have an exact sequence
$\infty \rightarrow S\hookrightarrow T\rightarrow T/S\rightarrow \infty$ and we can smash this sequence with $U$. Then we obtain a sequence
\[ \infty\xrightarrow{\;\phi_1} \{s\wedge u\mid s\wedge u=\infty \text{ in } T\wedge_N U\} \xrightarrow{\;\phi_2} S\wedge_N U\xrightarrow{\;\phi_3}
T\wedge_N U\xrightarrow{\;\phi_4} (T/S)\wedge_N U\xrightarrow{\;\phi_5}\infty,\]
where $\phi_2$ is the inclusion, $\phi_3(s\wedge u)=s\wedge u\in T\wedge_N U$, $\phi_4(t\wedge u)=[t]\wedge u$ and $\phi_5([t]\wedge u)=\infty$.
We know by definition that
$\operatorname{im}\phi_1 =\{\infty\}= \ker\phi_{2}$, $\operatorname{im}\phi_2 =\{s\wedge u\mid s\wedge u=\infty \text{ in } T\wedge_N U\}= \ker\phi_{3}$, $\operatorname{im}\phi_3 =S\wedge_N U= \ker\phi_{4}$, $\operatorname{im}\phi_4 =T/S\wedge_N U= \ker\phi_{5}$.
So it is an exact sequence.
\end{proof}
\begin{example}
\label{example of not strongly exact}
Let $N=\mathbb N^\infty$ and $S$ be an $N$-set with an operation given by $n+s=f^n(s)$, where $f:S \rightarrow S$ is a pointed map. Then we have an exact sequence
\[\infty\longrightarrow N_+\longrightarrow N\longrightarrow N/N_+\longrightarrow\infty \]
and we can smash this sequence with $S$ over $N$.
Then by Proposition \ref{exact sequence}, we get an exact sequence
\[\infty\rightarrow \{n\wedge s\mid n\geqslant 1, n\wedge s=\infty \text{ in } N\wedge_N S\}\rightarrow N_+\wedge_N S
\rightarrow N\wedge_N S\rightarrow N/N_+\wedge_N S\rightarrow\infty. \]
We have also isomorphisms
\[N\wedge_N S\longrightarrow S,\;n\wedge s\longmapsto n+s=f^n(s),\]
\[N_+\wedge_N S\longrightarrow S,\;n\wedge s\longmapsto (n-1)+s=f^{n-1}(s),\]
and from here we get
$\{n\wedge s\mid n\geqslant 1, n\wedge s=\infty \text{ in } N\wedge_N S\}\cong\{t\in S\mid f(t)=p\}=\ker f$ and
$N/N_+\wedge_N S\cong S/\operatorname{im} f$.
So we have an exact sequence
\[\infty\longrightarrow \ker f\longrightarrow S\xrightarrow{\;f\;} S \longrightarrow S/\operatorname{im} f\longrightarrow\infty.\]
If $S=\{a,b,p\}$, $f(a)=f(b)=b$ and $f(p)=p$ then this sequence is not strongly exact.
\end{example}

\begin{proposition}
\label{strongly exact sequence}
Let $N$ be a binoid, $J\subseteq N$ an ideal and $S\subseteq T$ be $N$-sets. Then we have a strongly exact sequence of $N$-sets
\[\infty \! \xrightarrow{\phi_1}  \{s\wedge [a]\mid s\wedge [a] \! = \! \infty \text{ in } T\wedge_N N/J\}
\! \xrightarrow{\phi_2} S\wedge_N N/J\xrightarrow{\phi_3} T\wedge_N \! N/J  \! \xrightarrow{\phi_4} T/S\wedge_N N/J
\! \xrightarrow{\phi_5} \! \infty \]
which is the same as
\[ \infty \! \xrightarrow{\phi_1}(S\cap(J+T))/(J+S) \xrightarrow{\phi_2}
S/(J+S)\xrightarrow{\phi_3}T/(J+T)\xrightarrow{\phi_4}(T/S)/(J+T/S))\xrightarrow{\phi_5} \! \infty. \]
If $S=I$ is an ideal of $N$ and $T=N$, then we have the strongly exact sequence
\[\infty\longrightarrow (I\cap J)/(I+J) \longrightarrow I/(I+J) \longrightarrow N/J\longrightarrow (N/I)/(J+N/I)\longrightarrow\infty. \]
\end{proposition}
\begin{proof}
From Proposition \ref{exact sequence}, when $U=N/J$, we have an exact sequence
\[ \infty \! \xrightarrow{\phi_1} \{s\wedge [a]\mid s\wedge [a]=\infty \text{ in } T\wedge_N N/J\}\! \xrightarrow{\phi_2}
S\wedge_N N/J \! \xrightarrow{\phi_3} \! T\wedge_N \!  N/J \! \xrightarrow{\phi_4} T/S\wedge_N \! N/J \! \xrightarrow{\phi_5} \! \infty. \]
By Proposition \ref{quotient} we know that $S\wedge_N N/J\cong S/(J+S)$ and $T\wedge_N N/J\cong T/(J+T)$.
Let
\[s\wedge [a]\in\{s\wedge [a]\mid s\wedge [a]=\infty \text{ in } T\wedge_N N/J\}. \]
Then $S/(J+S)\ni[a+s]=\infty\in T/(J+T)$. So we have $a+s\in J+T$, which means that $a+s\in S\cap (J+T)$. Hence we have
\[\{s\wedge [a]\mid s\wedge [a]=\infty \text{ in } T\wedge_N N/J\}\cong(S\cap(J+T))/(J+S).\]
Also, by Proposition \ref{quotient} and Proposition \ref{quotient to union}, we get
\[ T/S\wedge_N N/J\cong (T/S)/(J+T/S)=T/(S\cup(J+T)). \]
So we can rewrite the previous exact sequence as
\[\infty\xrightarrow{\phi_1}(S\cap(J+T))/(J+S) \xrightarrow{ \phi_2}S/(J+S)\xrightarrow{\phi_3}T/(J+T)\xrightarrow{\phi_4}(T/S)/(J+T/S))\xrightarrow{\phi_5}\infty \]
or, equivalently
\[ \infty\xrightarrow{\phi_1}(S\cap(J+T))/(J+S) \xrightarrow{
\phi_2}S/(J+S)\xrightarrow{\phi_3}T/(J+T)\xrightarrow{\phi_4}T/(S\cup(J+T))\xrightarrow{\phi_5}\infty. \]
Here $\phi_1(\infty)=\infty$, $\phi_2$ is the inclusion (so it is injective), $\phi_3$ is an inclusion (injective) on $S\setminus (J+T)$, $\phi_4$ is surjective and outside of the kernel it is a bijection, $\phi_5([s])=\infty$. So it means that our sequence is a strongly exact sequence.

If $S=I$ and $T=N$ then we get
\[ \infty\xrightarrow{\;\phi_1}I\cap J/(J+I) \xrightarrow{\;\phi_2}I/(J+I)\xrightarrow{\;\phi_3}N/J\xrightarrow{\;\phi_4}(N/I)/(J+N/I)\xrightarrow{\;\phi_5}\infty.\qedhere \]
\end{proof}

\begin{proposition}
\label{general equation of exact seq}
Let $N$ be a binoid and $\infty \rightarrow S_1 \rightarrow S_2 \rightarrow\cdots\rightarrow S_n\rightarrow \infty$ a strongly exact sequence of finite $N$-sets. Then
 \[ \sum_{i=1}^n (-1)^i\# S_i=0. \]
\end{proposition}
\begin{proof}
Write $S_i=K_i\uplus R_i\uplus \{p_i\}$, with maps
 \[ \begin{aligned}
  \phi_i:S_{i-1}&\longrightarrow S_i,\\
      R_{i-1}&\xrightarrow{bij} K_i,\\
      K_{i-1}&\longrightarrow p_i,\\
      p_{i-1}&\longrightarrow p_i,
  \end{aligned}
\]
where $1 \leqslant i \leqslant n+1,$
\[ S_0=S_{n+1}=\{\infty\},\;p_0=p_{n+1}=\infty, \]
and
\[ R_0=K_0=K_1=K_{n+1}=R_{n+1}=\varnothing. \]
Then we can conclude that
\[\sum_{i=1}^n (-1)^i\# S_i \! =\! \sum_{i=1}^n (-1)^i(|K_i|+|R_i|) \! = \! \sum_{i=1}^n (-1)^i(|K_i|+|K_{i+1}|)\!=\!-| K_1 |+(-1)^n |K_{n+1} | \! =\!0. \]
\end{proof}
\begin{corollary}
\label{equality of e.s. corollary}
Let $N$ be a finitely generated, semipositive binoid and let $I$ be an ideal of $N$. If $J$ is an $N_+$-primary ideal of $N$ then
\[\# N/J+\# I\cap J/(I+J)=\# I/(I+J)+\# (N/I)/(J+N/I).\]
\end{corollary}
\begin{proof}
We want to apply Proposition \ref{general equation of exact seq} to the strongly exact sequence
\[\infty\longrightarrow I\cap J/(I+J) \longrightarrow I/(I+J) \longrightarrow N/J\longrightarrow (N/I)/(J+N/I)\longrightarrow\infty \]
from Proposition \ref{strongly exact sequence}. To do this we have to show that the involved $N$-sets are finite.
We know that $N/J$ is a finite set.
Also we know that $I$ is a finitely generated $N$-set, so by Proposition \ref{surj map to smash} we have a surjective homomorphism
$(N/J)^{\cupdot r}\rightarrow I\wedge_N N/J$. Hence $|I\wedge_N N/J |=|I/(J+I)|\leqslant |N/J|^r$,
which is a finite set. So we can apply Proposition \ref{general equation of exact seq} and get the result.
\end{proof}

\section{Algebras and Modules}

In this section we will assume that $K$ is a commutative ring (or just a field). We associate to a binoid a binoid algebra over $K$
essentially in the same way how monoids yield monoid algebras.

\begin{definition}
The \emph{binoid algebra} of a binoid $N$ is the quotient algebra \[ KN/\langle X^\infty\rangle=:K[N], \]
where $KN$ is the monoid algebra of $N$ and $\langle X^\infty\rangle$ is the ideal in $KN$ generated by the element $X^\infty$.
\end{definition}
So we can consider $K[N]$ as the set of all formal sums $\sum_{m\in M}r_m X^m,$ where $M\subseteq N^\bullet$ is finite, $r_m\in K$ and the multiplication is given by
\[ r_nX^n\cdot r_m X^m=\left\{
    \begin{array}{ccc}
     (r_nr_m)X^{n+m},&\text{ if } n+m\in N^\bullet \\
     0,&\text{ if } n+m=\infty. \\
      \end{array}
       \right. \]
For an $N$-set $(S,p)$ we define the $K[N]$-module $K[S]$ as the set of all formal sums $\sum_{s\in U}r_s X^s,$ where $U\subseteq S^\bullet=S \setminus \{p\}$ is finite, $r_s\in K$
and the multiplication is given by
\[(\sum_{m\in M}r_m X^m)\cdot (\sum_{s\in U}r_s X^s)=\left\{
    \begin{array}{ccc}
     \sum_{m\in M,s\in U}r_mr_s X^{m+s},&\text{ if } m+s\in S^\bullet \\
     0,&\text{ if } m+s=p. \\
      \end{array}
       \right. \]
Here $M$ is a finite subset of $N$ and $U$ is a finite subset of $S$. For an ideal $I \subseteq N$ we get an ideal
\[ K[I]:=\{\sum_{a\in J}r_a X^a\mid  J\subseteq I \text{ finite subset }\} \] of $K[N]$. In this case we have the natural identification
$K[N/I]\cong K[N]/K[I]$. In the same way we have $K[S/T] \cong K[S]/K[T]$. For a finite $N$-set $S$ we have $\# S=\dim_K K[S]$.

\begin{proposition}
\label{exact sequence of K algebra}
Let $N$ be a binoid,
\[\infty \longrightarrow S_1 \longrightarrow S_2 \longrightarrow\cdots\longrightarrow S_n\longrightarrow \infty \]
a strongly exact sequence of finite $N$-sets and $K$ a commutative ring. Then we have an exact sequence of $K[N]$-modules
\[ 0 \longrightarrow K[S_1] \longrightarrow K[S_2] \longrightarrow\cdots\longrightarrow K[S_n]\longrightarrow 0. \]
\end{proposition}
\begin{proof}
See \cite[Proposition 1.9.6]{Batsukhthesis}.
\end{proof}

\begin{example}
Let $S=\{a,b,p\}$ be as in Example \ref{example of not strongly exact}. Then we have an exact sequence of $N$-sets
\[\infty\longrightarrow\ker f=\infty\xrightarrow{\;i\;\,} S\xrightarrow{\;f\;} S\longrightarrow S/\operatorname{im} f\longrightarrow\infty.\]
We have
\[ K[f](X^a-X^b)=X^{f(a)}-X^{f(b)}=X^b-X^b=0, \]
but $X^a-X^b\notin \operatorname{im} K[i]=\{\infty\}$.
So strong exactness is a necessary condition for Proposition \ref{exact sequence of K algebra}.
\end{example}

\begin{proposition}
\label{smash to tensor}
Let $N$ be a binoid and $S,T$ the $N$-sets. Then we have
\[K[S\wedge_N T]\cong K[S]\otimes_{K[N]} K[T]\]
and
\[K[S\cupdot T]\cong K[S]\oplus K[T].\]
\end{proposition}
\begin{proof}
See Corollary 3.5.2 in \cite{Simone} and \cite[Proposition 1.9.8]{Batsukhthesis}.
\end{proof}

\begin{proposition}
\label{K algebra of quotient}
Let $N$ be a binoid, $S$ be an $N$-set and $I$ be an ideal of $N$. Then we have \[K[S/(I+S)]\cong K[S]/(K[I]K[S]). \]
\end{proposition}
\begin{proof}
By Proposition \ref{quotient} we have $S/(I+S)\cong (N/I)\wedge_N S$, so $K[S/(I+S)]\cong K[(N/I)\wedge_N S]$. Hence from the compatibility of the $K$-functor
with the residue class construction, Proposition \ref{smash to tensor} and the general isomorphism $R/I \otimes_R V \cong V/IV$ we get
\[
\begin{aligned}
K[S/(I+S)]&\cong K[(N/I)\wedge_N S] \\
&\cong K[N/I]\otimes_{K[N]} K[S]\\
&\cong (K[N]/K[I])\otimes_{K[N]} K[S] \\
&\cong K[S]/(K[I]K[S]).
\end{aligned} \]
\qedhere
\end{proof}

\begin{lemma}
\label{semipositive binoid algebra}
Let $N$ be a semipositive binoid and $K$ some field of characteristic $p$ which does not divide $|N^\times|$. Then $K[N_+]$ is the intersection of finitely many maximal ideals. In particular, if $N$ is a positive binoid then $K[N_+]$ is a maximal ideal of $K[N]$.
\end{lemma}
\begin{proof}
Because of the fundamental theorem for finite abelian groups we can write
\[ N^\times=\mathbb Z/(\alpha_1)\times\cdots\times \mathbb Z/(\alpha_r).\]
By assumption $p$ does not divide $\alpha_1,\dots,\alpha_r$. So from these conditions we can deduce that
\[\begin{aligned}
\overline{K}N^\times &\cong \overline{K}[X_1,\dots,X_r]/(X_1^{\alpha_1}-1,\dots,X_r^{\alpha_r}-1)\\
&=\overline{K}[X_1,\dots,X_r]/\big((X_1-\xi_{11})\cdots(X_1-\xi_{1\alpha_1}),\dots,
(X_r-\xi_{r1})\cdots(X_r-\xi_{r\alpha_r})\big)\\
&\cong\overline{K}[X_1]/\big((X_1-\xi_{11})\cdots(X_1-\xi_{1\alpha_1})\big)\otimes\cdots
\otimes\overline{K}[X_r]/\big((X_r-\xi_{r1})\cdots(X_r-\xi_{r\alpha_r})\big)\\
&\cong\overline{K}^{|N^\times|},
  \end{aligned} \]
where $\overline{K}$ is the algebraic closure of $K$ and $\xi_{ij}$ are the $\alpha_i$-th roots of unity.
Hence the maximal ideals of $\overline{K}N^\times$ have the form
\[\mathfrak{m}_{i_1,\dots,i_r}=(X_1-\xi_{1i_1},\dots,X_r-\xi_{ri_r}).\]
So we have finitely many maximal ideals in $\overline{K} N^\times$ with this form.
We also know that the intersection of all maximal ideals of $\overline{K} N^\times$ is equal to $\operatorname{nil} (\overline{K} N^\times)$ and this is $0$.
Under the homomorphism $KN^\times\hookrightarrow\overline{K}N^\times$ the preimage of a maximal ideal is maximal and therefore the intersection of the maximal ideals of
$KN^\times$ is 0 as well.

Let $K[\pi]:K[N]\rightarrow K[N/N_+]$ be the homomorphism induced by $\pi:N\rightarrow N/N_+\cong (N^\times)^\infty$. Then $K[\pi]^{-1}(\mathfrak{m_i})$ is a maximal ideal
of $K[N]$, where $\mathfrak{m_i}$ is a maximal ideal of $K[N^\times]$. So
\[K[N_+]=K[\pi]^{-1}(0)=\bigcap_i K[\pi]^{-1}(\mathfrak{m_i}).\qedhere \]
\end{proof}

\section{The Hilbert-Kunz function of a binoid}

In this Section we introduce the Hilbert-Kunz function of a binoid. It is defined for a natural number $q$, an $N_+$-primary ideal $\mathfrak{n}$ and a finitely generated $N$-set $T$,
where $N$ fulfills some natural properties. The first lemma ensures that this function exists.

\begin{lemma}
Let $N$ be a finitely generated, semipositive binoid, $T$ a finitely generated $N$-set and $\mathfrak{n}$ an $N_+$-primary ideal of $N$. Then for every positive integer $q$ we have
\[\# T/([q]\mathfrak{n}+T)\leqslant r|N^\times|+D q^s,\] where $r$ is the number of generators of $T$, $s$ is the number of generators of $N_+$ and $D$ is some constant.
\end{lemma}
\begin{proof}
Let $t_1,\dots,t_r$ be generators of $T$ and $n_1,\dots,n_s$ be generators of $N_+$. If $t\in T$ then either \[ t=u+t_i,\] where $u\in N^\times$, or \[t=a_1n_1+\cdots+a_sn_s+t_i,\] where $a_j\in \mathbb N,1\leqslant i \leqslant r$.
There are at most $r|N^\times|$ elements of the first type. In the second case we know by the primary property that there exist $d_i\in\mathbb N$ such that
$d_in_i\in \mathfrak{n}$ for $1\leqslant i \leqslant s$. So if $a_j\geqslant qd_j$, for some $j$, then $t\in [q]\mathfrak{n}+T$, which means
\[ \# T/([q]\mathfrak{n}+T)\leqslant r|N^\times|+r\cdot q^s\cdot\prod_{i=1}^s d_i.\qedhere \]
\end{proof}

\begin{definition}
Let $N$ be a finitely generated, semipositive binoid, $T$ a finitely generated $N$-set and $\mathfrak{n}$ an $N_+$-primary ideal of $N$. Then we call the number \[\hkf^N(\mathfrak{n},T,q)=\hkf(\mathfrak{n},T,q):=\# T/([q]\mathfrak{n}+T)=|T/([q]\mathfrak{n}+T)|-1\] the \emph{Hilbert-Kunz function} of $\mathfrak{n}$ on the $N$-set $T$ at $q$.
\end{definition}
In particular, for $T=N$ and $\mathfrak{n}=N_+$ we have \[\hkf(N,q):=\hkf(N_+,N,q)=\#N/[q]N_+.\]
\begin{example}
\label{N^n}
Let $N=(\mathbb N^n)^\infty$ then $\hkf(N,q)=\# N/[q]N_+=q^n$. Since $N_+=(\mathbb N^n)^\infty\setminus \{0\}$ we have $[q]N_+=\bigcup_{i=1}^n qe_i+N$, where $e_i$ is the $i$-th standard vector of $\mathbb N^n$. Hence \[N/[q]N_+=\{(a_1,\dots,a_n)\in \mathbb N^n\mid 0\leqslant a_i\leqslant q-1\}\cup\{\infty\},\] which means $\# N/[q]N_+=q^n$.
\end{example}

\begin{lemma}
\label{HKF of annihilator}
Let $N$ be a finitely generated and semipositive binoid, $(T,p)$ a finitely generated $N$-set and $\mathfrak{n}$ an $N_+$-primary ideal of $N$. Let $\mathfrak{a}\subseteq \operatorname{Ann} T$ be an ideal of $N$, where $\operatorname{Ann} T$ is the annihilator of $T$.
Then $T$ is also an $N/\mathfrak{a}$-set and we have
\[\hkf^N(\mathfrak{n},T,q)=\hkf^{N/\mathfrak{a}}((\mathfrak{n}\cup\mathfrak{a})/\mathfrak{a},T,q).\]
\end{lemma}
\begin{proof}
Let us first show that $(\mathfrak{n}\cup\mathfrak{a})/\mathfrak{a}$ is an $(N/\mathfrak{a})_+$-primary ideal of $N/\mathfrak{a}$.
If there is an element $[m]\in (N/\mathfrak{a})_+$,
where $m\in N$ then there exists $l\in\mathbb N$ such that $lm\in\mathfrak{n}$ and so $l[m]=[lm]\in(\mathfrak{n}\cup\mathfrak{a})/\mathfrak{a}$.
Let us define the action $(N/\mathfrak{a})\times T\longrightarrow T$ by $(\overline{n},t)\longrightarrow \overline{n}+t=n+t$.
Then it is easy to see that this is well defined, that
\[ \begin{tikzpicture}[node distance=2cm, auto]
  \node (N) {$N\times T$};
  \node (T) [right of=N]  {$T$};
  \node (N1) [below of=N]   {$(N/\mathfrak{a})\times T$};
  \node (T1) [below of=T]   {$T$};
  \draw[->] (N) to node {}(T);
  \draw[->] (N) to node {}(N1);
  \draw[->] (N1) to node {}(T1);
  \draw[->] (T) to node {}(T1);
  \end{tikzpicture}
\]
commutes and so $T$ is an $N/\mathfrak{a}$-set. For every $q\in \mathbb N$ we have $[q]\mathfrak{n}+T=[q](\mathfrak{n}\cup\mathfrak{a})/\mathfrak{a}+T$,
as this is the image of $[q]\mathfrak{n}\times T$. Therefore
\[ \#T/([q]\mathfrak{n}+T)=\#T/([q](\mathfrak{n}\cup\mathfrak{a})/\mathfrak{a}+T).\qedhere \]
\end{proof}

\begin{lemma}
\label{HKF ineq}
Let $N$ be a finitely generated, semipositive binoid, $S$ and $T$ finitely generated $N$-sets and $\mathfrak{n}$ an $N_+$-primary ideal of $N$.
Suppose that we have a surjective $N$-set homomorphism $\phi:S\rightarrow T$.
Then for all $q$
\[\hkf(\mathfrak{n},S,q)\geqslant \hkf(\mathfrak{n},T,q).\]
\end{lemma}
\begin{proof}
By definition $[q]\mathfrak{n}$ is an ideal of $N$. So by Lemma \ref{surj hom} we have a surjective homomorphism
$S/([q]\mathfrak{n}+S)\longrightarrow T/([q]\mathfrak{n}+T)$. Hence
\[\hkf(\mathfrak{n},S,q)= |S/([q]\mathfrak{n}+S) |-1\geqslant | T/([q]\mathfrak{n}+T) |-1=\hkf(\mathfrak{n},T,q).\qedhere \]
\end{proof}
\begin{definition}
Let $N$ be a finitely generated, semipositive binoid, $T$ a finitely generated $N$-set and $\mathfrak{n}$ an $N_+$-primary ideal of $N$.
Then the \emph{Hilbert-Kunz multiplicity} of $\mathfrak{n}$ on the $N$-set $T$ is defined by
\[ e_{HK}(\mathfrak{n},T):=\lim_{q\rightarrow \infty} \frac{\hkf^N(\mathfrak{n},T,q)}{q^{\dim N}},\]
if this limit exists.

In particular for $T=N$ and $\mathfrak{n}=N_+$ we set $e_{HK}(N):=e_{HK}(N_+,N)$ and denote it the \emph{Hilbert-Kunz multiplicity} of $M$.
\end{definition}
Note that here we work with the combinatorial dimension of $N$.

\begin{theorem}
\label{bound of HKF}
Let $N$ be a finitely generated, semipositive binoid and $\mathfrak{n}$ an $N_+$-primary ideal of $N$. If $T$ is a finitely generated $N$-set and $\hkf(\mathfrak{n},N,q)\leqslant Cq^{\dim N}$ for every $q\in \mathbb N$ and some constant $C$ (in particular, if $e_{HK}(\mathfrak{n},N)$ exists) then there exists $\alpha$ such that $\hkf(\mathfrak{n},T,q)\leqslant \alpha q^{\dim N}$.
\end{theorem}
\begin{proof}
By Lemma \ref{canonical isomorphism}, we have a canonical isomorphism $N^{\cupdot r}/([q]\mathfrak{n}+N^{\cupdot r})\longrightarrow (N/[q]\mathfrak{n})^{\cupdot r}$, which means that $\# ( N^{\cupdot r}/([q]\mathfrak{n}+N^{\cupdot r})) = \# ( (N/[q]\mathfrak{n})^{\cupdot r} ) = r\cdot \#(N/[q]\mathfrak{n})\leqslant r\cdot Cq^{\dim N}$.

From Lemma \ref{surj map for f.g. set}, we have a surjective map $\phi:N^{\cupdot r}\longrightarrow T$, where $r$ is the number of generators of $T$. Also by Lemma \ref{surj hom}, we know that there exists a surjective homomorphism
\[\tilde{\phi}:N^{\cupdot r}/([q]\mathfrak{n}+N^{\cupdot r}) \longrightarrow T/([q]\mathfrak{n}+T).\]
So by Lemma \ref{HKF ineq} we have $\hkf(\mathfrak{n},T,q)\leqslant \alpha q^{\dim N}$, where $\alpha=r\cdot C$.
\end{proof}

\begin{lemma}
\label{multiplicity of smash product}
Let $M$ and $N$ be finitely generated, semipositive binoids. Then we have
\[\hkf(M\wedge N,q)=\hkf(M,q)\cdot \hkf(N,q).\]
\end{lemma}
\begin{proof}
We have
\[(M\wedge N)_+=(M\wedge N)\setminus (M^\times\wedge N^\times)=(M_+\wedge N)\cup (M\wedge N_+). \]
Take an element $q(m\wedge n)+m_1\wedge n_1\in [q](M\wedge N)_+$, where $m\wedge n\in (M\wedge N)_+$. Then $m\wedge n\in M_+\wedge N$ or $m\wedge n\in M\wedge N_+$, so $qm+m_1\in [q]M_+$ or $qn+n_1\in [q]N_+$, which means
\[[q](M\wedge N)_+\subseteq ([q]M_+\wedge N)\cup (M\wedge [q]N_+).\]
We can also easily check the other inclusion, so we have
\[[q](M\wedge N)_+= ([q]M_+\wedge N)\cup (M\wedge [q]N_+).\]
Hence, from this result and Lemma \ref{smash of quotients}, we get
\[(M\wedge N)/[q](M\wedge N)_+\cong (M/[q]M_+)\wedge (N/[q]N_+).\]
By assumption $M,N$
are semipositive, so we know $M/[q]M_+$ and $N/[q]N_+$ are finite binoids. Hence, by Proposition \ref{number of elements of smash}, we can conclude that
\[ \# \big((M\wedge N)/[q](M\wedge N)_+\big)=\# (M/[q]M_+) \cdot \# (N/[q]N_+).\qedhere \]
\end{proof}

\begin{theorem}
\label{multiplicity of smash}
Let $M$ and $N$ be binoids such that $e_{HK}(M)$ and $e_{HK}(N)$ exist. Then $e_{HK}(M\wedge N)$ exists and
\[e_{HK}(M\wedge N)=e_{HK}(M)\cdot e_{HK}(N).\]
\end{theorem}
\begin{proof}
By definition
\begin{align*}
e_{HK}(M)\cdot e_{HK}(N)&=\lim_{q\rightarrow \infty} \frac{\hkf(M,q)}{q^{\dim M}}\cdot \lim_{q\rightarrow \infty} \frac{\hkf(N,q)}{q^{\dim N}}\\
&=\lim_{q\rightarrow \infty} \frac{\hkf(M,q)\cdot \hkf(N,q)}{q^{\dim M+\dim N}}\\
&\overset{\text{Lemma } \ref{multiplicity of smash product}}{=}\lim_{q\rightarrow \infty} \frac{\hkf(M\wedge N,q)}{q^{\dim M+\dim N}}\\
&\overset{\text{Theorem } \ref{dimension of smash product}}{=}\lim_{q\rightarrow \infty} \frac{\hkf(M\wedge N,q)}{q^{\dim M\wedge N}}\\
&=e_{HK}(M\wedge N).
\end{align*}
\end{proof}

\section{Reduction to the integral and reduced case}

We want to show that the Hilbert-Kunz multiplicity of a finitely generated semipositive cancellative reduced binoid exists by reducing it to the toric (not necessarily normal) case, i.e. to the case of a integral cancellative torsionfree binoid which was proven by Eto (\cite{Eto}). If $N$ is such a monoid and $N \subseteq \hat{N} \subseteq \operatorname{diff} N$ its normalization,
and $   {\mathfrak n} $ a primary ideal with generators $f_1, \ldots , f_n$,
then the Hilbert-Kunz multiplicity $e_{HK} ( {\mathfrak n},N)$ equals $ e_{HK} (  {\mathfrak n} \hat{N}, \hat{N} )$, where $ {\mathfrak n} \hat{N}$ denotes
the extended ideal (see Lemma \ref{finite birational extension} below). If we write the normal toric positive monoid $\hat{N}$ as $\hat{N} =C \cap \Gamma $ with a polyhedral cone $C$ and the lattice $\Gamma=\operatorname{diff} N \setminus \{\infty\}$,
then the Hilbert-Kunz multiplicity is the volume of the region inside $C$ and outside of $ \bigcup_{i =1}^n f_i +C$.

In this Section we show how to reduce the existence and rationality of the Hilbert-Kunz multiplicity to the integral and the reduced case.
\begin{lemma}
\label{reduction of torsion free}
Suppose that for all finitely generated, semipositive, cancellative, integral and torsion-free binoids of dimension less or equal to $d$ the Hilbert-Kunz multiplicity exists. Then
\begin{enumerate}
\item Let $N$ be a finitely generated, semipositive, cancellative, torsion-free, reduced  binoid of dimension $d$ and let $\{\mathfrak{p}_1,\dots,\mathfrak{p}_s\}$ be all minimal prime ideals of  dimension $d$. Then the Hilbert-Kunz multiplicity of $N$ exists, and
\[e_{HK}(N)=\sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i).\]
\item Let $N$ be a finitely generated, semipositive, cancellative binoid of dimension $d$ and torsion-free except for nilpotent elements. Then we have
\[\hkf(N,q)\leqslant Cq^{\dim N},\]
for all $q$, where $C$ is some constant.
\end{enumerate}
\end{lemma}
\begin{proof}
We have finitely many minimal prime ideals $\{\mathfrak{p}_1,\dots,\mathfrak{p}_n\}$ and $n\geqslant s$.
From reducedness we have $\bigcap_{i=1}^n \mathfrak{p}_i=\operatorname{nil}(N)=\{\infty\}$ by  \cite[Corollary 2.3.10]{Simone}. If $f\notin [q]N_+$ and $f\in [q]N_+\cup \mathfrak{p}_i$ for all $i$,
then $f\in \bigcap_{i=1}^n \mathfrak{p}_i=\{\infty\}$, which implies $N\setminus[q]N_+\subseteq \bigcup_{i=1}^n N\setminus([q]N_+\cup\mathfrak{p}_i)$.
Also by Proposition \ref{quotient to union} and the set identifications
\[ N\setminus[q]N_+\cong (N/[q]N_+)\setminus \{\infty\}, \]
\[ N\setminus([q]N_+\cup\mathfrak{p}_i)\cong (N/([q]N_+\cup\mathfrak{p}_i))\setminus \{\infty\}\]
we can conclude that
\[N\setminus[q]N_+\subseteq \bigcup_{i=1}^n (N/\mathfrak{p}_i)\setminus[q](N/\mathfrak{p}_i)_+. \]
Since $N/\mathfrak{p}_i$ is finitely generated, semipositive, cancellative, torsion-free and integral by assumption we know that
\[\hkf(N/\mathfrak{p}_i,q)=e_{HK}(N/\mathfrak{p}_i)q^{d_i}+O(q^{d_i-1}),\]
where $d_i:=\dim N/\mathfrak{p}_i$. Hence only the minimal prime ideals
with dimension $d_i=d$ are important and we can write
\begin{equation}
\# N/[q]N_+\leqslant \sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i)q^d+O(q^{d-1}).
\end{equation}

Let us denote $H:=N/[q]N_+$. Then
\[N/([q]N_+\cup\mathfrak{p}_i)=(H\setminus \mathfrak{p}_i)\cup\{\infty\}\]
and
\[ N/([q]N_+\cup\mathfrak{p}_i\cup\mathfrak{p}_j)=\big((H\setminus \mathfrak{p}_i)\cap (H\setminus \mathfrak{p}_j)\big)\cup\{\infty\}.\]
Hence from set theory we know that
\[ |H\setminus \{\infty\}|\geqslant |\bigcup_{i=1}^n H\setminus\mathfrak{p}_i|\geqslant \sum_{i=1}^n |H\setminus\mathfrak{p}_i|-\sum_{1\leqslant i<j\leqslant n} |(H\setminus \mathfrak{p}_i)\cap (H\setminus \mathfrak{p}_j)|.\]
So from here we have
\[\#  N/[q]N_+\geqslant \sum_{i=1}^n \# N/([q]N_+\cup\mathfrak{p}_i)-\sum_{1\leqslant i<j\leqslant n}\# N/([q]N_+\cup\mathfrak{p}_i\cup\mathfrak{p}_j). \]
But we know that $N/(\mathfrak{p}_i\cup\mathfrak{p}_j)$ is finitely generated, semipositive, cancellative, torsion-free and integral so by Proposition \ref{quotient to union} and the assumption we get
\begin{align*}
\sum_{i\neq j}\# N/([q]N_+\cup\mathfrak{p}_i\cup\mathfrak{p}_j)&=\sum_{i\neq j}\hkf(N/(\mathfrak{p}_i\cup\mathfrak{p}_j),q)\\
&=\sum_{i\neq j}\Big(e_{HK}(N/(\mathfrak{p}_i\cup\mathfrak{p}_j))q^{d_{ij}}+O(q^{d_{ij}-1})\Big),
\end{align*}
 where $d_{ij}$ is the dimension of $N/(\mathfrak{p}_i\cup\mathfrak{p}_j)$. By Lemma \ref{dimension properties} we also know that $d_{ij}<\min\{d_i,d_j\}$. So we have
\begin{equation}
\#  N/[q]N_+\geqslant \sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i)q^d+O(q^{d-1}).
\end{equation}
Hence from (1) and (2) we get
\[e_{HK}(N)=\lim_{q\rightarrow \infty} \dfrac{\hkf(N,q)}{q^d}=\sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i). \]
To prove the second statement, note that $\operatorname{nil}(N)$ is an ideal of $N$ and $N_{\operatorname{red}}:=N/\operatorname{nil}(N)$ is reduced.
Let $a_1,\dots,a_s$ be the generators of $\operatorname{nil}(N)$ and $k_ia_i=\infty$ but $(k_i-1)a_i\neq \infty$, where $k_i\in \mathbb N,1\leqslant i\leqslant s$.
We have a finite decreasing sequence
\[N=M_0\longrightarrow M_1\longrightarrow \cdots \longrightarrow M_{t-1}\longrightarrow M_t=N_{\operatorname{red}},\]
where $M_{k_0+\cdots+k_i+j}=M_{k_0+\cdots+k_i+j-1}/((k_{i+1}-j)a_{i+1}),1\leqslant j\leqslant k_{i+1}-1,0\leqslant i\leqslant s-1$ and $k_0=0$.
Here we have $2(k_{i+1}-j)a_{i+1}=\infty$ in $M_{k_0+\cdots+k_i+j}$.
So in particular there exists a sequence such that
\[M_{i+1}=M_i/(f_i),2f_i=\infty \text{ in }M_i,0\leqslant i\leqslant t-1\]
and $M_0=N,M_t=N_{\operatorname{red}}$.
Hence there exists also such a sequence with this property of minimal length $l$.
We will use induction on $l$ to prove this Lemma.

For $l=0$ we are in the reduced situation and the statement follows from the case above. So suppose that $l$ is arbitrary and that for smaller $l$ the statement is already proven. Suppose
that a sequence as described is given. This means in particular that we have a strongly exact sequence
\[\infty \!  \longrightarrow (f)+N  \ensuremath{\lhook\joinrel\relbar\joinrel\rightarrow} N  \longtwoheadrightarrow N/(f) \! \longrightarrow \! \infty,\]
where $f=f_0$.  Hence $M:=N/(f)$ has a decreasing sequence with the described property of length smaller than $l$,
so by the induction hypothesis we know that $\# M/[q]M_+\leqslant Dq^d$ for some constant $D$. By Corollary \ref{equality of e.s. corollary} we also have
\[\# N/[q]N_+ +\# \big((f)\cap [q]N_+\big)/((f)+[q]N_+)=\# ((f)+N)/((f)+[q]N_+)+\# M/([q]N_++M).\]
Since $2f=\infty$, we know that $f$ annihilates the $N$-set $(f)+N$. So $(f)+N$ is a finitely generated $M$-set ($f$ is the only $M$-set generator of $(f)+N).$
Hence by Lemma \ref{surj map for f.g. set} we have a surjective homomorphism $M\longrightarrow (f)+N$, which implies
\[\# ((f)+N)/((f)+[q]N_+)\leqslant\# M/[q]M_+.\]
But we also know that $[q]M_+\subseteq [q]N_++M$, so we have that
\[\# M/([q]N_++M)\leqslant\# M/[q]M_+.\]
From here we can conclude
that
\[\# N/[q]N_+\leqslant\# M/[q]M_++\# M/([q]N_++M)\leqslant 2Dq^d.\qedhere \]
\end{proof}

The same reduction steps hold when we allow torsion.
\begin{lemma}
\label{reduction}
Suppose that for all finitely generated, semipositive, cancellative and integral binoids of dimension less or equal to $d$ the Hilbert-Kunz multiplicity exists. Then
\begin{enumerate}
 \item Let $N$ be a finitely generated, semipositive, cancellative and reduced  binoid of dimension $d$ and let $\{\mathfrak{p}_1,\dots,\mathfrak{p}_s\}$ be all minimal prime ideals of dimension $d$.
 Then the Hilbert-Kunz multiplicity of $N$ exists, and
\[e_{HK}(N)=\sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i).\]
 \item Let $N$ be a finitely generated, cancellative and semipositive binoid of dimension $d$. Then
 \[\hkf(N,q)\leqslant Cq^d,\]
 for all $q$, where $C$ is some constant.
\end{enumerate}
\end{lemma}
\begin{proof}
The proof is similar to the one of Lemma \ref{reduction of torsion free}.
\end{proof}

The following Lemma reduces in particular the case of a non-normal toric binoid to the normal toric case. A finite $N$-binoid $M$ is an $N$-binoid which is finitely generated as an $N$-set.
\begin{lemma}
\label{finite birational extension}
Suppose that for all finitely generated, cancellative, semipositive, integral binoids of dimension less than $d$, the Hilbert-Kunz function is bounded by $Cq^{d-1}$ for some constant $C$. Let $N$ be a finitely generated, semipositive, cancellative, integral binoid of dimension $d$ and let $\mathfrak{n}$ be an $N_+$-primary ideal of $N$. Let $M$ be a finite $N$-binoid which is birational over $N$. Suppose that $e_{HK}(\mathfrak{n}+M,M)$ exists. Then $e_{HK}(\mathfrak{n},N)$ exists and it is equal to $e_{HK}(\mathfrak{n}+M,M)$.
\end{lemma}
\begin{proof}
First note that $\mathfrak{n}+M$ is an $M_+$-primary ideal. By Proposition \ref{strongly exact sequence} applied to the $N$-sets $S=N,T=M$ and the ideal $J=[q]\mathfrak{n}$ we have the strongly exact sequence
\[\infty \! \longrightarrow (N\cap([q]\mathfrak{n}+M))/[q]\mathfrak{n} \! \longrightarrow \! N/[q]\mathfrak{n} \! \longrightarrow M/([q]\mathfrak{n}+M) \! \longrightarrow  (M/N)/([q]\mathfrak{n}+M/N) \! \longrightarrow\infty.\]
By Proposition \ref{general equation of exact seq},
we know that
\[ \# (N\cap([q]\mathfrak{n}+M))/[q]\mathfrak{n} + \# M/([q]\mathfrak{n}+M) = \# N/[q]\mathfrak{n} +\#(M/N)/([q]\mathfrak{n}+M/N) \]
and we have
\[ \# M/([q]\mathfrak{n}+M) \leqslant \# N/[q]\mathfrak{n} +\#(M/N)/([q]\mathfrak{n}+M/N). \]
It is easy to check that there exists (a common denominator) $b\in N$ such that $b+M\subseteq N$, and that $I:=b+M\neq\{\infty\}$ is an ideal of $N$ which is isomorphic to $M$, because $N$ is an integral binoid. We also know that $I$ annihilates $M/N$,
so $M/N$ is an $N/I$-set and $N/I$ is a finitely generated, semipositive, cancellative binoid
and torsion-free up to nilpotence.
So by Lemma \ref{HKF of annihilator} we have that
\[\# (M/N)/([q]\mathfrak{n}+M/N)=\hkf(\mathfrak{n},M/N,q)=\hkf^{N/I}((I\cup\mathfrak{n})/I,M/N,q)\]
and by Lemma \ref{dimension properties} we know that $\dim N/I<d$, so from the assumptions and by Lemma \ref{reduction of torsion free} we get
\[\hkf^{N/I}((I\cup\mathfrak{n})/I,M/N,q)\leqslant C q^{d-1}.\]
Hence we have
\begin{equation}
 \#  M/([q]\mathfrak{n}+M)-Cq^{d-1} \leqslant \# N/[q]\mathfrak{n}.
\end{equation}
By Corollary \ref{equality of e.s. corollary}, we deduce
\[\# N/[q]\mathfrak{n}\leqslant\# I/(I+[q]\mathfrak{n})+\# (N/I)/([q]\mathfrak{n}+N/I).\]
But we know that $\# (N/I)/([q]\mathfrak{n}+N/I)=\hkf(\mathfrak{n},N/I,q)$ and $I$ annihilates $N/I$. Similarly we can show that
\[\hkf^N(\mathfrak{n},N/I,q)=\hkf^{N/I}((I\cup\mathfrak{n})/I,N/I,q)\leqslant C'q^{d-1},\]
where $C'$ is some constant.
Since $I\cong M$, we have that $\# I/(I+[q]\mathfrak{n})=\# M/([q]\mathfrak{n}+M)$, so we can conclude that
\[\# N/[q]\mathfrak{n}\leqslant\# M/([q]\mathfrak{n}+M)+C'q^{d-1}.\]
From the last result and $(3)$ we have that
\[e_{HK}(\mathfrak{n},N)=  \operatorname{lim}_{q \rightarrow \infty}      \frac{  \# M/([q]\mathfrak{n}+M)}{q^d}.\]
Since extended ideals commute with Frobenius sums, we have $\# M/([q]\mathfrak{n}+M)=\# M/[q](\mathfrak{n}+M)$, which means that
\[e_{HK}(\mathfrak{n},N)=e_{HK}(\mathfrak{n}+M,M).\]
\end{proof}

\begin{theorem}
\label{not integral, reduced}
Let $N$ be a finitely generated, positive, cancellative, torsion-free and  reduced binoid and let $\{\mathfrak{p}_1,\dots,\mathfrak{p}_s\}$ be all minimal prime ideals with dimension $d=\dim N$.
Then
\[e_{HK}(N)=\lim_{q\rightarrow \infty} \dfrac{\hkf(N,q)}{q^d}=\sum_{i=1}^s e_{HK}(N/\mathfrak{p}_i)\]
exists and it is a rational number.
\end{theorem}
\begin{proof}
This follows from Lemma \ref{reduction of torsion free} (1) and the toric case.
\end{proof}

\begin{example}
\label{simplicial}
Let $\operatorname{\triangle}$ be a simplicial complex on the vertex set $V$. The binoid associated to $\operatorname{\triangle}$ is given by $F(V)/I_{\operatorname{\triangle}}=:M_{\operatorname{\triangle}}$, where $I_{\operatorname{\triangle}}$ is
the ideal $\{ f\in F(V)\mid  \operatorname{supp}(f)\nsubseteq \operatorname{\triangle}\}$ of the free binoid $F(V)\cong (\mathbb N^{|V|})^\infty$. In this case we have
$e_{HK}(M_{\operatorname{\triangle}})=k $,
where $k$ is the number of facets of maximal dimension. This rests on Theorem \ref{not integral, reduced} and the facts that simplicial binoids are positive cancellative torsion-free and reduced,
that faces correspond to prime ideals and facets to minimal prime ideals and that $M_{\operatorname{\triangle}}/ \mathfrak{p} \cong {\mathbb N}^{\operatorname{dim} M_{\operatorname{\triangle}} }$
for the minimal prime ideals, see \cite[Chapter 6]{Simone}.
\end{example}

\begin{lemma}
\label{not integral and torsion free up to nilpotence}
Let $N$ be a finitely generated, positive, cancellative binoid which is torsion-free up to nilpotence. Then $\hkf(N,q)\leqslant Cq^d$,where $C$ is some constant and $d=\dim N$.
\end{lemma}
\begin{proof}
This follows from the toric case and Lemma \ref{reduction of torsion free} (2).
\end{proof}
\begin{corollary}
\label{bound for N/I}
Let $N$ be a finitely generated, integral, positive, cancellative and torsion-free binoid and let $I\neq \infty$ be an ideal of $N$. Then $\hkf(N/I,q)\leqslant Cq^d$,where $C$ is some constant and $d=\dim N/I$.
\end{corollary}
\begin{proof}
We know by \cite[Lemma 2.1.20]{Simone}, that $N/I$ is torsion-free up to nilpotence and finitely generated, positive, cancellative.
So by Lemma \ref{not integral and torsion free up to nilpotence} we have the result.
\end{proof}

\begin{lemma}
\label{ideal case}
Let $N$ be a finitely generated, positive, cancellative, integral and torsion-free binoid and let $I\neq \infty$
be an ideal of $N$. Then $e_{HK}(I)$ exists and is equal to $e_{HK}(N)$.
\end{lemma}
\begin{proof}
By Corollary \ref{equality of e.s. corollary} we have
\[  \# N/[q]N_+ +\# I\cap [q]N_+/(I+[q]N_+)=\# I/(I+[q]N_+)+\# (N/I)/[q](N/I)_+ . \]
By Corollary \ref{bound for N/I} we know that $\hkf(N/I,q)\leqslant Dq^{d'}$, where $d'=\dim N/I<d$. Hence from $(2.11)$ we get
\begin{equation}
\# I/(I+[q]N_+)\geqslant \hkf(N,q)-\# (N/I)/[q](N/I)_+\geqslant \hkf(N,q)-Dq^{d'}.
\end{equation}

Let $\infty\neq f\in I$. Then we have a strongly exact sequence $\infty\rightarrow (f)\rightarrow I\rightarrow I/(f)\rightarrow\infty$. So we have
\[\# I/(I+[q]N_+)\leqslant \# (f)/((f)+[q]N_+)+\# (I/(f))/[q](I/(f))_+.\]
By Lemma \ref{HKF of annihilator}, the $N$-set  $I/(f)$ is an $N/(f)$-set.
By Corollary \ref{bound for N/I} we know that $\hkf(N/(f),q)\leqslant Dq^{d''}$, where $d''=\dim N/(f)<d$ and by Theorem \ref{bound of HKF} we have $\hkf(I/(f),q)\leqslant \alpha q^{d''}$. Hence we can conclude that
\begin{equation}
 \# I/(I+[q]N_+)\leqslant \# (f)/((f)+[q]N_+)+\alpha q^{d''}.
\end{equation}

But we know that $(f)=f+N$ is isomorphic to $N$ as an $N$-set so
\[\# (f)/((f)+[q]N_+)=\hkf(N,q).\]
Now by $(4)$ and $(5)$ we have
\[\begin{aligned}e_{HK}(N)&=\lim_{q\rightarrow\infty} \frac{\hkf(N,q)-Dq^{d'}}{q^d}\\
&\leqslant \lim_{q\rightarrow\infty} \frac{\# I/(I+[q]N_+)}{q^d}=e_{HK}(I)\\
&\leqslant\lim_{q\rightarrow\infty} \frac{\hkf(N,q)+\alpha q^{d''}}{q^d}=e_{HK}(N)\end{aligned}\]
\end{proof}

\section{Integral and cancellative binoids with torsion}

Let $N$ be a finitely generated, semipositive, cancellative and integral binoid. We know that
\[N\subseteq \operatorname{diff} N\cong(\mathbb Z^m\times T)^\infty=(\mathbb Z^m)^\infty\wedge T^\infty, \]
where smashing is over the trivial binoid $\mathbb T=\{0,\infty\}$.
Here  $T$ is the torsion part of the difference group, which is a finite commutative group, hence $T=\mathbb Z/k_1\times\cdots \times \mathbb Z/k_l$. We will write elements $x\in N^\bullet$ as $x=f\wedge t$ with $f\in\mathbb Z^m$ and $t\in T$. This representation is unique.

The relation $\sim_{\operatorname{tf}}$ on $N$ given by $a\sim_{\operatorname{tf}} b$ if $na=nb$ for some $n\geqslant 1$ is a congruence and $N_{\operatorname{tf}}:=N/\sim_{\operatorname{tf}}$ is a torsion-free binoid which we call the \emph{torsion-freefication} of $N$. If $F=\{f\in (\mathbb Z^m)^\infty\mid  \exists t\in T, f\wedge t\in N\}$ then $N_{\operatorname{tf}}\cong F\subseteq \mathbb Z^m$. Hence we may assume $N\subseteq F\wedge T^\infty$ and $f\wedge t_1\sim_{\operatorname{tf}} g\wedge t_2$ if and only if there exists $n\in\mathbb N$ such that $n(f\wedge t_1)=n (g\wedge t_2)$, which means $f=g\in F$. We define the subsets $F\wedge t:=\{g\wedge t \mid g\in F\}$, $F_t:=\{f\in F \mid f\wedge t\in M\}$ and $M_t:=F_t\wedge t$.

\begin{proposition}
Let $F$ be a finitely generated, positive, cancellative, integral and torsion-free binoid. If $T$ is a finite group then
$e_{HK}(F\wedge T^\infty)=e_{HK}(F)\cdot |T|$.
\end{proposition}
\begin{proof}
This follows from the toric case, Theorem \ref{multiplicity of smash} and the fact that for a finite group binoid the Hilbert Kunz multiplicity is just the order of the group.
\end{proof}

In the following we write $N\subseteq F\wedge T^\infty$, where $F\cong N_{\operatorname{tf}}$, $T$ is a finite group and $\operatorname{diff} N=\operatorname{diff} F\wedge T^\infty$. The strategy is to relate the Hilbert-Kunz multiplicity of $N$ with that of $F\wedge T^\infty$.

\begin{lemma}
\label{correspondence of ideals}
Let $F$ be a binoid and $T^\infty$ be a group binoid. Then we have a bijection between ideals of $F$ and ideals of $F\wedge T^\infty$. The $F_+$-primary ideals correspond to $(F\wedge T^\infty)_+$-primary ideals.
\end{lemma}
\begin{proof}
We have an inclusion
\[F \xrightarrow{\;i\;} F\wedge T^\infty,~f \longmapsto f\wedge 0.\]
So we can consider for an ideal in $F$ its extended ideal in $F\wedge T^\infty$, in other words we use the map $\mathfrak{a}\mapsto \mathfrak{a}+F\wedge T^\infty$.
For ideal generators $f_j\wedge t_j,j\in J$, in $F\wedge T^\infty$ we have
\[\langle f_j\wedge t_j\mid j\in J\rangle=\langle f_j\wedge 0\mid j\in J\rangle\subseteq F\wedge T^\infty,\]
because $0\wedge t_j$ are units.
Hence the map $\mathfrak{b}\mapsto i^{-1}(\mathfrak{b})$, where $\mathfrak{b}$ is an ideal of $F\wedge T^\infty$, is inverse to the extension map.
Let $\mathfrak{p}\subseteq F$ be an $F_+$-primary ideal and $f\wedge t\in (F\wedge T^\infty)_+$. Then there exists $l\in\mathbb N$ such that $lf \in \mathfrak{p}$, so $l(f\wedge t)=lf\wedge lt=(lf\wedge 0)+(0\wedge lt) \in \mathfrak{p}+F\wedge T^\infty$, because $0\wedge lt$ is a unit.
Now let $\mathfrak{q}$ be an $F\wedge T^\infty_+$-primary ideal and $f\in F_+$. Then $f\wedge 0\in F\wedge T^\infty$ is not a unit, so there exists $m\in \mathbb N$ such that $m(f\wedge 0)=mf\wedge 0\in \mathfrak{q}$. Hence $mf \in i^{-1}(\mathfrak{q})$.
\end{proof}

\begin{lemma}
\label{finite birational ext}
Let $N$ be a finitely generated, semipositive, cancellative, integral binoid. If $F=N_{\operatorname{tf}}$ and $T$ is the torsion subgroup of $\operatorname{diff} N$ then $F\wedge T^\infty$ is finite and birational over $N$.
\end{lemma}
\begin{proof}
We can assume that $\operatorname{diff} N=(\mathbb Z^d)^\infty\wedge T^\infty$, where $d=\dim N$, $T=\{t_1,\dots,t_m\}$ is a finite abelian group. We know $F\wedge T^\infty \subseteq \operatorname{diff} N$, so it is clear that $F\wedge T^\infty$ is birational over $N$. If $f\wedge t\in (F\wedge T^\infty)^\bullet$ then there exists $t'\in T$ such that $f\wedge t'\in N$ and
\begin{equation}
m(f\wedge t)=mf\wedge mt=mf\wedge 0=mf\wedge mt'=m(f\wedge t')\in N,
\end{equation}
which means that these elements satisfy a pure integral equation over $N$. Let $f_i\wedge t_i,1\leqslant i \leqslant k$, be the generators of $N$, then $\{f_i\wedge t_j,\mid 1\leqslant i \leqslant k,1\leqslant j \leqslant m\}$ will give us an $N$-generating system of $F\wedge T^\infty$.
This means that $F\wedge T^\infty$ is finite over $N$.
\end{proof}
Note that the notion birational makes sense though the corresponding binoid algebras are not integral in general.
\begin{lemma}
\label{F smash T}
Let $F$ be a finitely generated, positive, cancellative, torsion-free, integral binoid, $T^\infty$ be a torsion group binoid and $\mathfrak{p}$ be an $F_+$-primary ideal of $F$. Then
\[\hkf^{F\wedge T^\infty}(\mathfrak{p}+F\wedge T^\infty,F\wedge T^\infty,q)=|T|\cdot \hkf^F(\mathfrak{p},F,q).\]
In particular, the Hilbert-Kunz multiplicity exists and
\[e_{HK}^{F\wedge T^\infty}(\mathfrak{p}+F\wedge T^\infty,F\wedge T^\infty)=|T|\cdot e_{HK}^F(\mathfrak{p},F).\]
\end{lemma}
\begin{proof}
For every $q\in\mathbb N$ we have by Lemma \ref{smash of quotients}
\[F\wedge T^\infty/([q]\mathfrak{p}\wedge T^\infty\cup F\wedge (\infty))=F\wedge T^\infty/[q]\mathfrak{p}\wedge T^\infty\cong F/[q]\mathfrak{p}\wedge T^\infty,\]
and $[q]\mathfrak{p}\wedge T^\infty=[q]\mathfrak{p}+F\wedge T^\infty$. Hence
\[ F\wedge T^\infty/([q]\mathfrak{p}+F\wedge T^\infty)\cong F/[q]\mathfrak{p}\wedge T^\infty,\]
which means
\[ \hkf^{F\wedge T^\infty}(\mathfrak{p}+F\wedge T^\infty,F\wedge T^\infty,q)=|T|\cdot \hkf^F(\mathfrak{p},F,q). \]
The existence of the Hilbert-Kunz multiplicity follows from the toric case.
\end{proof}

Let $N$ be a binoid with $N\subseteq F\wedge T^\infty$, where $F\cong N_{\operatorname{tf}}$, $T$ a finite group. Then we have the following diagram.
\[\begin{tikzpicture}[node distance=2cm, auto]
  \node (F) {F};
  \node (FT) [below of=F]  {$F\wedge T^\infty$};
  \node (N) [left of=FT]   {$N$};
  \draw[->] (N) to node {} (FT);
  \draw[->] (F) to node [swap] {$i$} (FT);
\end{tikzpicture}
\]
where $i(f)=f\wedge 0$.

\begin{theorem}
\label{HKM with torsion binoid}
Let $N$ be a finitely generated, semipositive, cancellative, integral binoid and $\mathfrak{n}$ be an $N_+$-primary ideal of $N$. Then
\[e_{HK}^N(\mathfrak{n},N)=|T|\cdot e_{HK}^F(\mathfrak{m},F),\]
where $F=N_{\operatorname{tf}}$, $T$ is the torsion subgroup of $\operatorname{diff} N$ and $\mathfrak{m}=i^{-1}(\mathfrak{n}+F\wedge T^\infty)$ is an ideal of $F$.
\end{theorem}
\begin{proof}
We know that $\mathfrak{n}+F\wedge T^\infty$ is a primary ideal and by Lemma \ref{correspondence of ideals} that $\mathfrak{m}$ is an $F_+$-primary ideal of $F$. So by Lemma \ref{F smash T} we know that $e_{HK}(\mathfrak{m}+F\wedge T^\infty,F\wedge T^\infty)$ exists and is equal to $|T|\cdot e_{HK}^F(\mathfrak{m},F)$.
By Lemma \ref{correspondence of ideals} we know that $\mathfrak{m}+F\wedge T^\infty=\mathfrak{n}+F\wedge T^\infty$ so
\[ e_{HK}^{F\wedge T^\infty}(\mathfrak{n}+F\wedge T^\infty,F\wedge T^\infty)=e_{HK}^{F\wedge T^\infty}(\mathfrak{m}+F\wedge T^\infty,F\wedge T^\infty). \]
Because of Lemma \ref{finite birational ext} and using induction over the dimension we can apply Lemma \ref{finite birational extension}.
Hence $e_{HK}^N(\mathfrak{n},N)$ exists and is equal to
\[ e_{HK}^{F\wedge T^\infty}(\mathfrak{n}+F\wedge T^\infty,F\wedge T^\infty)=|T|\cdot e_{HK}^F(\mathfrak{m},F). \]
\end{proof}

\begin{theorem}
\label{f.g,s.p,c,r binoid}
Let $N$ be a finitely generated, semipositive, cancellative, reduced binoid and $\mathfrak{n}$ be an $N_+$-primary ideal of $N$. Then $e_{HK}(\mathfrak{n},N)$ exists and is rational number.
\end{theorem}
\begin{proof}
This follows directly from Lemma \ref{reduction} and Theorem \ref{HKM with torsion binoid}.
\end{proof}

\begin{example}
The binoid $\langle x,y\rangle/ax=ay$ (for $a\in \mathbb N_+$) can be realized as $\langle (1\wedge 0),(1\wedge 1)\rangle\subseteq \mathbb N\wedge (\mathbb Z/a)^\infty$.
In this case, the torsion-freefication is $\mathbb N$ and the Hilbert-Kunz multiplicity is $a$ by Theorem \ref{HKM with torsion binoid},
since $e_{HK}((\mathbb N)^\infty)=1$ by Example \ref{N^n} and $HKF( (\mathbb Z/a)^\infty,q)=|(\mathbb Z/a)|$.
\end{example}

\begin{example}
Let $a=(2,1),b=(3,0)\in (\mathbb N \times \mathbb Z/2)^\infty$ be the generators of a binoid $N$. This binoid is not torsion-free, since $(6,1) \neq (6,0)$, but $2 (6,1) \neq 2 (6,0)$.
The binoid is positive, its normalization $\hat{N} = (\mathbb N \times \mathbb Z/2)^\infty$ is only semipositive.
It is not difficult to see that  $N_{\operatorname{tf}}\cong\mathbb N^\infty\setminus \{1\}$ and the torsion group is $T=\mathbb Z/2$. So by Theorem \ref{HKM with torsion binoid},
we have
\[e_{HK}(N)=|T|\cdot e_{HK}(N_{\operatorname{tf}})=2\cdot 2=4.\]
\end{example}

\begin{example}
Let $N=\langle X,Y,Z\rangle/4X+12Y=16Z$ be a binoid. From \cite[Lemma 2.2.9]{Batsukhthesis} we have an injective binoid homomorphism $\phi:N\rightarrow \big(\mathbb Z^2\times \mathbb Z/16\mathbb Z\big)^\infty$.
So $\phi(N)$ has generators $(16,0,0), (0,16,0), (4,12,1)$. If we choose the new generators $u=(4,-4,1),~v=(0,16,0),~w=(0,0,4)$, then $\phi(X)=4u+v-w$, $\phi(Y)=v$, $\phi(Z)=u+v$.
Hence the difference group of our binoid is isomorphic to $\mathbb Z^2\times \mathbb Z/4$.
The torsion-freefication of $N$ is $F=\langle X',Y',Z'\rangle/X'+3Y'=4Z'$ with $e_{HK}(F)=\frac{13}{4}$ by the toric case,
so $e_{HK}(N)=13$ by Theorem \ref{HKM with torsion binoid}.
\end{example}

\section{Hilbert-Kunz function of binoid rings}

We finally want to relate the Hilbert-Kunz function of a binoid $N$ to the Hilbert-Kunz function of its binoid algebra $K[N]$. However, $K[N]$ is not a local ring. If $N$ is positive, then $K[N]$ contains the unique combinatorial maximal ideal $K[N_+]$ and we work with the localization $K[N]_{K[N_+]}$.
In this setting we get by counting the dimension and Proposition \ref{K algebra of quotient}, immediately
\[ HKF^N\!(\mathfrak{n},S,q) \! =\! \# \big(S/(S+[q]\mathfrak{n})\big) \!=\!\dim_K\! K[S]/(K[S]\cdot K[\mathfrak{n}]^{[q]}) \! =\! HKF^{K[N]}(K[\mathfrak{n}],K[S],q). \]
So the rationality results of the previous sections translates directly to results on the Hilbert-Kunz multiplicity of the localization of a binoid algebra.

This translation is more involved for semipositive binoids. We have seen in Lemma \ref{semipositive binoid algebra}
that $K[N_+]$ is the intersection of finitely many maximal ideals $\mathfrak{m}_1,\dots,\mathfrak{m}_r$.
Then $T=K[N]\setminus\mathfrak{m}_1\cap\cdots\cap K[N]\setminus\mathfrak{m}_r$
is a multiplicatively closed subset of $K[N]$ and the localization $K[N]_T$ is a semilocal ring with maximal ideals
$\mathfrak{m}_i \cdot K[N]_T$ and $K[N_+]\cdot K[N]_T=\bigcap_{i=1}^r \mathfrak{m}_i\cdot K[N]_T$.

Now, for a semilocal Noetherian ring $R$ with Jacobson ideal $\mathfrak{m}=\bigcap_{i=1}^r \mathfrak{m}_i$ containing a field of positive characteristic, we can define the Hilbert-Kunz function as before.
For a finite $R$-module $M$ and an $\mathfrak{m}$-primary ideal $\mathfrak{n}$ we set
\[ \hkf^R(\mathfrak{n},M,q)=\operatorname{length}(M/\mathfrak{n}^{[q]}M). \]
If $J$ is an ideal in a Noetherian ring $R$ with $V(J)=\{\mathfrak{m}_1,\dots,\mathfrak{m}_r\}$, then
\[ \operatorname{length}^R(M/JM)=\operatorname{length}^{R_T}(M_T/JM_T) \]
for $T=\bigcap_{i=1}^r R\setminus \mathfrak{m}_i$. In this way we consider $K[N_+]$-primary ideals in $K[N]$ for a semipositive binoid $N$,
and we write $\hkf^{K[N]}(K[\mathfrak{n}],K[S],q)$ instead of $\hkf^{K[N]_T}(K[\mathfrak{n}]\cdot K[N]_T,K[S]_T,q)$.

\begin{theorem}
\label{HK binoid ring}
Let $K$ be a field of characteristic $p$, $N$ a finitely generated, semipositive binoid, $S$ an $N$-set, $\mathfrak{n}$ an $N_+$-primary ideal and $q=p^e$. Then we have
\[\hkf^N(\mathfrak{n},S,q)=\hkf^{K[N]}(K[\mathfrak{n}],K[S],q).\]
\end{theorem}
\begin{proof}
We know, from Proposition \ref{K algebra of quotient}, that
\[K[S/(S+[q]\mathfrak{n})]\cong K[S]/(K[S]\cdot K[\mathfrak{n}]^{[q]}),\] and by a dimension count we can conclude that
\[\# (S/(S+[q]\mathfrak{n}))=\dim_K K[S/(S+[q]\mathfrak{n})]=\dim_K K[S]/(K[S]\cdot K[\mathfrak{n}]^{[q]}).\]
\end{proof}

\begin{theorem}
\label{HKM binoid ring and binoid}
Let $K$ be a field of characteristic $p$, $N$ a finitely generated, semipositive binoid. Suppose that $\dim N=\dim K[N]$ and $e_{HK}(\mathfrak{n},N)$ exists. Then
\[e_{HK}^{K[N]}(K[\mathfrak{n}],K[N])=e_{HK}(\mathfrak{n},N)\]
 and it is independent of the (positive) characteristic of $K$.
\end{theorem}
\begin{proof}
If we take $S=N$ in Theorem \ref{HK binoid ring} then we have
\[\hkf^{K[N]}(K[\mathfrak{n}],K[N],q)=\hkf^N(\mathfrak{n},N,q).\]
By assumption $(q=p^e,d=\dim N)$
\[e_{HK}(\mathfrak{n},N)=\lim_{q\rightarrow \infty} \!\dfrac{\hkf^N(\mathfrak{n},N,q)}{q^d}=\lim_{e\rightarrow \infty} \! \dfrac{\hkf^{K[N]}(K[\mathfrak{n}],K[N],q)}{q^d}=e_{HK}^{K[N]}(K[\mathfrak{n}],K[N]).\]
\end{proof}

\begin{theorem}[Miller conjecture for cancellative binoid rings]
\label{Miller conjecture}
Let $K$ be a field of characteristic $p$, $N$ a binoid.
Suppose that $\dim N=\dim K[N]$ and $e_{HK}(\mathfrak{n},N)$ exists. Then
 \[\lim_{p\rightarrow\infty} \frac{\hkf^{(\mathbb Z/p)[N]}((\mathbb Z/p)[\mathfrak{n}],(\mathbb Z/p)[S],p)}{p^{\dim N}}\] exists and equals
 \[\lim_{p\rightarrow\infty} e_{HK}^{(\mathbb Z/p)[N]}((\mathbb Z/p)[\mathfrak{n}],(\mathbb Z/p)[S]).\]
\end{theorem}
\begin{proof}
This follows from the identity $\hkf^{(\mathbb Z/p)[N]}((\mathbb Z/p)[\mathfrak{n}],(\mathbb Z/p)[S],p)=\hkf^N(\mathfrak{n},S,p)$ from Theorem \ref{HK binoid ring} and the existence of the limit over all numbers.
\end{proof}

\begin{theorem}
\label{existsrational}
Let $K$ be a field of characteristic $p$, $N$ be a finitely generated, semipositive, cancellative, reduced binoid and $\mathfrak{n}$ be an $N_+$-primary ideal of $N$. Then
\[e_{HK}^{K[N]}(K[\mathfrak{n}],K[N])\]
exists, is independent of the characteristic of $K$ and it is a rational number.
\end{theorem}
\begin{proof}
By Theorem \ref{f.g,s.p,c,r binoid} we know that $e_{HK}(\mathfrak{n},N)$ exists and that it is a rational number. So by Theorem \ref{HKM binoid ring and binoid} we have the result.
\end{proof}