text:
\section{Introduction}

Our aim in this paper is to prove a result about $r$-uniform hypergraphs that can
be viewed in two complementary ways, either as a probabilistic result or as an enumerative one.
In this section we shall state the enumerative form; in the next section we
switch to the probabilistic viewpoint, which we shall adopt for most of the paper,
and in particular in the proofs.

It is easy to see that if $H$ is an $r$-uniform hypergraph then
\[
 |H|\le c(H)+(r-1)e(H),
\]
where $|H|$ is the number of vertices of $H$, $e(H)$ is the number of edges,
and $c(H)$ is the number of components, with equality if and only if
$H$ is a forest, i.e., every component of $H$ is a tree.
Define the \emph{nullity} $n(H)$ of $H$ as
\begin{equation}\label{nulldef}
 n(H) = c(H)+(r-1)e(H)-|H|,
\end{equation}
so $n(H)\ge 0$, and $H$ is a tree iff $c(H)=1$ and $n(H)=0$. Note for later that, if $H$ is connected, then $|H|+n(H)-1$ must be a multiple of $r-1$.
If we replace each
hyperedge of $H$ by a tree on the same set of $r$ vertices,
then $n(H)$ is simply the nullity of the resulting (multi-)graph.
Connected graphs or hypergraphs are naturally parameterised by the number of vertices
and the nullity, although often the \emph{excess} $n(H)-1$ is considered instead.

One of the most basic questions about any class of combinatorial (or other) structures is:
how many such structures are there with given `size' parameters? Or, sometimes
more naturally, how many `irreducible' structures? For (labelled) graphs and hypergraphs,
the first question is trivial, but the second, taking `irreducible' to mean
connected, certainly is not, and it is no surprise that it has been extensively
studied. Given integers $r\ge 2$, $s\ge 1$ and $t\ge 0$, let $C_r(s,t)$
be the number of connected
$r$-uniform hypergraphs on $[s]=\{1,2,\ldots,s\}$ having nullity $t$.
(Thus $C_r(s,t)=0$ if $r-1$ does not divide $s+t-1$.)
Starting with Cayley's formula $C_2(s,0)=s^{s-2}$, the asymptotic evaluation
of $C_2(s,t)$ was studied by Wright~\cite{Wright1,Wright2,Wright3,Wright4}
and others for increasingly broad ranges of $t=t(s)$, culminating in the results of
Bender, Canfield and McKay~\cite{BCMcK} giving an asymptotic formula for $C_2(s,t)$
whenever $s\to\infty$, for any function $t=t(s)$.

For $r\ge 3$, much less is known. Selivanov~\cite{Selivanov} gave an exact
formula for the number $C_r(s,0)$ of trees;
the remaining results we shall mention are all asymptotic,
with $r$ fixed, $s\to\infty$, and $t$ some function of $s$.
Karo\'nski and \L uczak~\cite{KL_sparse} gave an asymptotic
formula for $C_r(s,t)$ when
$t=o(\log s/\log\log s)$, so the hypergraphs counted are quite close to trees.
In an extended abstract from 2006, Andriamampianina and Ravelomanana~\cite{AR} outlined
an extension of this to the case $t=o(s^{1/3})$. Recently, Behrisch, Coja-Oghlan and Kang~\cite{BC-OK2b}
gave an asymptotic formula for $C_r(s,t)$ when $t=\Theta(s)$; their proof was based on probabilistic
methods, which seem to work best when $t$ is relatively large, rather than the enumerative
methods most successful for small $t$.
Independently and essentially simultaneously with the present work,
Sato and Wormald~\cite{SatoWormald} (see also Sato~\cite{Sato}) have given
an asymptotic formula for $C_r(s,t)$ when $r=3$, $t=o(s)$ and $t/(s^{1/3}\log^2 s)\to\infty$.

Our main result complements those in~\cite{BC-OK2b}, and greatly extends those in~\cite{KL_sparse,SatoWormald},
covering
the entire range $t\to\infty$, $t=o(s)$. The formula we obtain is rather complicated; to state it we
need some definitions.

Given an integer $r\ge 2$ and a real number $0<\rho<1$, define
\begin{equation}\label{Prdef}
 \Psi_r(\rho) = -\frac{r-1}{r}\frac{\log(1-\rho)}{\rho}\frac{1-(1-\rho)^r}{1-(1-\rho)^{r-1}} -1.
\end{equation}
It is easy to see that $\Psi_r(\rho)$ is strictly increasing on $(0,1)$,
since each of the factors $-\log(1-\rho)/\rho$ and $(1-(1-\rho)^r)/(1-(1-\rho)^{r-1})$ is.
Since $\Psi_r$ is continuous, considering the limiting values at $0$ and $1$ we see
that $\Psi_r$ gives a bijection from $(0,1)$ to $(0,\infty)$.

\begin{theorem}\label{thenum}
Let $r\ge 2$ be fixed, and let $t=t(s)$ satisfy $t\to\infty$ and $t=o(s)$ as $s\to\infty$.
Then when $s+t-1$ is divisible by $r-1$ the number $C_r(s,t)$ of connected
$r$-uniform hypergraphs on $[s]$ with nullity $t$
satisfies
\begin{equation}\label{enumform}
 C_r(s,t) \sim
  \frac{\sqrt{3}}{2\sqrt{\pi}} \frac{r-1}{\sqrt{s}}
 \left( \frac{ e \big(1-(1-\rho)^r\big) s^r }{m\ r!\ \rho^r} \right)^m
 \bigl( \rho(1-\rho)^{(1-\rho)/\rho}\bigr)^s
\end{equation}
as $s\to\infty$, where $\rho>0$ is the unique positive solution to
\begin{equation}\label{rdefc}
 \Psi_r(\rho) = \frac{t-1}{s},
\end{equation}
and $m=(s+t-1)/(r-1)$ is the number of edges of any such hypergraph.
Moreover, the probability $P_r(s,t)$ that a random $m$-edge $r$-uniform hypergraph on $[s]$
is connected satisfies
\begin{equation}\label{Pform}
 P_r(s,t)  \sim e^{r/2+\ind{r=2}} \sqrt{\frac{3(r-1)}{2}}  \left(\frac{1-(1-\rho)^r}{\rho^r}\right)^m
 \bigl( \rho(1-\rho)^{(1-\rho)/\rho}\bigr)^s,
\end{equation}
where $\ind{A}$ denotes the indicator function of $A$.
\end{theorem}

To appreciate this result it may help to note that $\Psi_r(x)=(r-1)x^2/12+O(x^3)$ as $x\to 0$, so
\[
 \rho \sim 2\sqrt{\frac{3}{r-1}\frac{t}{s}}
\]
when $t/s\to 0$. Also, it may be useful to note that rearranging \eqref{rdefc} gives $m/s=(\Psi_r(\rho)+1)/(r-1)$,
so we can rewrite the formulae \eqref{enumform} and \eqref{Pform} as functions of $s$ and $\rho$ only (or $m$ and $\rho$ only)
if we wish.

There are many ways to write a formula such as \eqref{enumform}, and checking whether two
such formulae agree may require some calculation. In the Appendix we present such calculations
showing that Theorem~\ref{thenum} matches the results of~\cite{BC-OK2pre,BC-OK2abs,BCMcK,KL_sparse,SatoWormald}
where the ranges of applicability overlap; it does not match the formula in~\cite{BC-OK2b},
which seems to contain an error. In particular, for the graph case (which of course is not our main focus),
\eqref{enumform} is consistent with (indeed, implied by) the Bender--Canfield--McKay formula~\cite{BCMcK}.
For hypergraphs, Theorem~\ref{thenum} shows that the asymptotic formula of Karo\'nski and \L uczak~\cite{KL_sparse}
extends not only to $t=o(s^{1/3})$, as they suspected, but to any $t=o(s^{1/2})$ (and no further).

We shall return to the topic of estimating $C_r(s,t)$ when $t/s\to\infty$ in a future paper.
Although we have not yet checked all the details, this regime seems to be much easier
to analyze than that considered here or by Behrisch, Coja-Oghlan and Kang.
The key point is that, following the approach taken in the next section, the random hypergraph
that one needs to analyze has average degree tending to infinity, which means that its behaviour
is relatively simple. In particular, with high probability all small components are trees.

\section{Probabilistic reformulation}

In this section we shall state a probabilistic result that turns out to be equivalent to
Theorem~\ref{thenum}; as we shall see, the formulae in this setting are significantly
simpler. In the rest of the paper we shall use probabilistic methods
to prove this reformulation, deducing Theorem~\ref{thenum} in Section~\ref{sec_deduce}.

For $2\le r\le n$ and $0<p<1$,
let $\Hrnp$ be the random $r$-uniform hypergraph with vertex set $[n]=\{1,2,\ldots,n\}$ in which
each of the $\binom{n}{r}$ possible hyperedges is present independently
with probability $p$.
Throughout we consider $r\ge 2$ fixed, $n\to\infty$, and
\[
 p=p(n)=\la (r-2)!n^{-r+1},
\]
where $\la=\la(n)=\Theta(1)$; often, we write $\la$ as $\la(n)=1+\eps(n)$.
It is well known (see Section~\ref{sec_past})
that the model $\Hrnp$ undergoes a phase transition at $\la=1$ analogous to that
established by Erd\H os and R\'enyi~\cite{ERgiant} in the
graph case, and indeed that the `window' of this phase transition is given by $\la=1+\eps$
with $\eps^3n=O(1)$; see~\cite{BR_hyp}.
For this reason, we call the model $\Hrnp$ \emph{subcritical} if $\la=1-\eps$
with $\eps=\eps(n)$ satisfying $\eps^3n\to\infty$, and \emph{supercritical} if $\la=1+\eps$
with $\eps^3n\to\infty$. Here we study the supercritical phase, so we make
the following assumption unless specified otherwise.

\begin{assumption}\label{A1} (Weak Assumption.)
The quantities $p(n)$, $\la(n)$ and $\eps(n)$ are related by
$\la=1+\eps$ and $p=\la (r-2)!n^{-r+1}$. Moreover, $r\ge 2$ is fixed
and, as $n\to\infty$, we have $\eps^3n\to\infty$ and $\eps=O(1)$.
\end{assumption}

Much of the time we additionally suppose that $\eps\to 0$, i.e., assume the following.

\begin{assumption}\label{A0} (Standard Assumption.)
The conditions of Assumption~\ref{A1} hold, and in addition $\eps\to 0$ as $n\to\infty$.
\end{assumption}

Given a hypergraph $H$, let $\cL_1(H)$ denote the component with the most vertices,
chosen according to any fixed rule if there is a tie. Let $L_1(H)=|\cL_1(H)|$,
$M_1(H)=e(\cL_1(H))$ and $N_1(H)=n(\cL_1(H))$ be the order, size and
nullity of this component. Our next result gives an asymptotic formula for the probability
that the triple $(L_1(\Hrnp),M_1(\Hrnp),N_1(\Hrnp))$ takes any specific
value within the `typical' range, throughout the supercritical regime.
Of course, since these three parameters are dependent,
the result can be stated in terms of any two of them; here we consider $L_1$ and $N_1$.
To state the result we need a few definitions.

For $\la>1$ let $\rho_{\la}$ be the unique positive solution to
\begin{equation}\label{rldef}
 1-\rho_{\la} = e^{-\la \rho_\la},
\end{equation}
so $\rho_\la$ is the survival probability of a Galton--Watson branching process
whose offspring distribution is Poisson with mean $\la$,
and define $\rho_{r,\la}$ by
\begin{equation}\label{rkldef}
 1-\rho_{r,\la} = (1-\rho_{\la})^{1/(r-1)}.
\end{equation}
Turning to the analogous parameter relevant to $N_1(\Hrnp)$, set
\begin{equation}\label{rhosdef}
 \rho_{r,\la}^* = \frac{\la}{r}\bb{1-(1-\rho_{r,\la})^r} - \rho_{r,\la}.
\end{equation}
As noted in~\cite{BR_hyp2}, if $\la=1+\eps$ then, as $\eps\to 0$ from above, we have
\begin{equation}\label{newrasympt}
 \rho_{r,\la} \sim \frac{2\eps}{r-1} \qquad\hbox{and}\qquad
 \rho_{r,\la}^* \sim \frac{2}{3(r-1)^2}\eps^3.
\end{equation}

\begin{theorem}\label{thprob}
Let $r\ge 2$ be fixed, let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$
where $\eps=\eps(n)$ satisfies $\eps\to 0$ and $\eps^3 n\to\infty$,
set $\la=\la(n)=1+\eps$ and define
$\rho_{r,\la}$ and $\rho^*_{r,\la}$ as above.
Then, whenever $x_n=\rho_{r,\la}n+O(\sqrt{n/\eps})$
and $y_n=\rho^*_{r,\la}n+O(\sqrt{\eps^3n})$, we have
\begin{equation}\label{pointprob}
 \Pr\bb{ L_1(\Hrnp) = x_n,\ N_1(\Hrnp)=y_n }
 \sim \frac{r-1}{\sigma_n\sigma^*_n}
    f\left(\frac{x_n-\rho_{r,\la}n}{\sigma_n},\frac{y_n-\rho^*_{r,\la}n}{\sigma^*_n}\right)
\end{equation}
as $n\to\infty$, where $\sigma_n=\sqrt{2n/\eps}$, $\sigma_n^*=\sqrt{10/3}(r-1)^{-1}\sqrt{\eps^3n}$,
and
\begin{equation}\label{pdf}
 f(a,b) = \frac{1}{2\pi\sqrt{2/5}}\exp\left(-\frac{5}{4}(a^2-2\sqrt{3/5}\,ab+b^2)\right)
\end{equation}
is the probability density function of a bivariate Gaussian distribution with
mean~$0$, unit variances, and covariance $\sqrt{3/5}$.
\end{theorem}

For ease of comparison with other results, note that combining \eqref{pointprob} and \eqref{pdf} results
in the expression
\begin{equation}\label{pp2}
 \frac{\sqrt{6}}{8\pi}\frac{(r-1)^2}{\eps n} \exp\left(-\frac{5}{4}(a^2-2\sqrt{3/5}\,ab+b^2)\right),
\end{equation}
with $a$ and $b$ the arguments of $f$ in \eqref{pointprob}.

The probability that the largest component of $\Hrnp$ has $\ell$  vertices and $m$ edges
is very closely related to the number
of connected hypergraphs with $\ell$ vertices and $m$ edges. This relationship
was used by Karo\'nski and {\L}uczak~\cite{KL_giant} to prove the special case of Theorem~\ref{thprob}
when $\eps^3n\to\infty$ but $\eps^3n=o(\log n/\log\log n)$.
Behrisch, Coja-Oghlan and Kang~\cite{BC-OK1,BC-OK2a} used probabilistic methods to prove a
result corresponding to Theorem~\ref{thprob} but with $\eps=\Theta(1)$ (i.e.,
roughly speaking, the case $\la$ constant), and then, in~\cite{BC-OK2b}, used this to deduce their enumerative
result mentioned in the previous section. We shall deduce Theorem~\ref{thenum}
from Theorem~\ref{thprob} in Section~\ref{sec_deduce}.

At a very high level, the strategy of the proof of Theorem~\ref{thprob} is similar
to that followed by Behrisch, Coja-Oghlan and Kang~\cite{BC-OK2a} for the
case $\eps=\Theta(1)$: we start from
the corresponding central limit theorem (proved very recently in~\cite{BR_hyp2}),
and apply `smoothing' arguments to deduce the local limit theorem. However,
the details are very different: Behrisch, Coja-Oghlan and Kang apply this technique to a univariate
result for $L_1$ only, and then use a different argument going via the hypergraph
model analogous to $G(n,m)$ to deduce a bivariate result. This method
does not appear to work when $\eps\to 0$. Instead, we apply two smoothing arguments; one
to handle the nullity (or excess), and then one for the number of vertices.

Bivariate local limit results do not necessarily imply the corresponding
univariate local limit results, due to the possibility of `bad' events
with small ($o(1)$) but not too small probability on which
one of the two parameters takes a `typical' value and the other does not.
However, the method used to prove Theorem~\ref{thprob} will easily give the following local limit
results for $L_1(\Hrnp)$ and $N_1(\Hrnp)$ separately.

\begin{theorem}\label{thL1only}
Let $r\ge 2$ be fixed, and let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$
where $\eps=\eps(n)$ satisfies $\eps\to 0$ and $\eps^3 n\to\infty$.
Set $\la=\la(n)=1+\eps$ and define $\rho_{r,\la}$ as in \eqref{rkldef}.
Then whenever $x_n=\rho_{r,\la}n+O(\sqrt{n/\eps})$ we have
\[
 \Pr\bb{ L_1(\Hrnp) = x_n} \sim \frac{1}{2\sqrt{\pi n/\eps}}
 \exp\left(-\frac{(x_n-\rho_{r,\la} n)^2}{4n/\eps}\right)
\]
as $n\to\infty$.
\end{theorem}

\begin{theorem}\label{thN1}
Let $r\ge 2$ be fixed, let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)\to 0$
and $\eps^3n\to\infty$, and set $\la=\la(n)=1+\eps$. For any $t_n\ge 0$ we have
\[
 \Pr(N_1(\Hrnp) = t_n) = \frac{1}{\sigma^*_n\sqrt{2\pi}} \exp\left(-\frac{(t_n-\rho^*_{r,\la}n)^2}{2(\sigma^*_n)^2}\right) + o(1/\sigma^*_n),
\]
where $\rho^*_{r,\la}$ is defined in \eqref{rhosdef} and $\sigma^*_n=\sqrt{10/3}(r-1)^{-1}\sqrt{\eps^3n}$.
\end{theorem}

Our main results assume our Standard Assumption~\ref{A0};
however, all our arguments can be extended, with
varying amounts of additional work (and more complicated statements), to require
only our Weak Assumption~\ref{A1}. Since the results of Behrisch, Coja-Oghlan and Kang~\cite{BC-OK1,BC-OK2a}
cover the case $\eps=\Theta(1)$, we assume $\eps\to 0$ much of the time for simplicity.

In the probabilistic setting, a local (central) limit theorem is not the last possible word.
One could ask for moderate and/or large deviation results (indeed, Eyal Lubetzky has asked
us this question). We have not pursued these questions, but for a wide range of the parameters
Lemma~\ref{lbigep} shows that the probability that the largest component of $\Hrnp$
has $s$ vertices and nullity $t$ is asymptotic to the expected number of components
of $\Hrnp$ with these parameters. This expectation can of course be calculated using
Theorem~\ref{thenum}. This method should give tight results for all moderate deviations
and some (but not all) large deviations.

\begin{remark}
Instead of the model $\Hrnp$ one could consider the analogue $\Hrnm$ of the original Erd\H os--R\'enyi
size model, where we select an $m$-edge $r$-uniform hypergraph on $[n]$ uniformly at random. Relating
$m$ and $p$ by $p=m/\binom{n}{r}$, Theorem~\ref{thprob} implies an analogous result
for this model. (This is not completely obvious, but can be shown using Theorem~\ref{thenum} as an intermediate
step; alternatively, one can use Lemma~\ref{lbigep} and its analogue for $\Hrnm$, and directly
relate the expected number of $s$-vertex $k$-edge components in the models $\Hrnp$ and $\Hrnm$.)
Behrisch, Coja-Oghlan and Kang~\cite{BC-OK2a} prove such a result in the denser setting ($\la>1$ constant).
Here, unlike in~\cite{BC-OK2a}, the parameters of the local limit theorem in $\Hrnm$ are exactly the same
as those in $\Hrnp$. Very informally this should be no surprise, since the conversion between models
corresponds to changing the number of edges by a random number of order $O(\sqrt{n})$. Such a change changes the typical
size of the giant component by $O(\sqrt{n})$ vertices, which (in our range) is small compared to the
standard deviation $\sqrt{n/\eps}$. Similarly, the change in the nullity from switching models
is $O(\eps^2\sqrt{n}) =o(\sqrt{\eps^3n})$.
\end{remark}

\subsection{Related work}\label{sec_past}

We have already mentioned a number of previous enumerative results related to
Theorem~\ref{thenum}. Before we outline a number of previous probabilistic results
related to Theorem~\ref{thprob}, we introduce some general terminology.

Let $(A_n)$ be a sequence of integer-valued random variables. We say that $(A_n)$ satisfies
a \emph{global limit theorem} with parameters $\mu_n$ and $\sigma_n$
if $(A_n-\mu_n)/\sigma_n$ converges in distribution to some
distribution $Z$ on the reals whose density function $\phi(x)$
is continuous and strictly positive.
We say that $(A_n)$ satisfies the corresponding \emph{local limit theorem}
if, for any sequence $(x_n)$ of integers with $x_n=\mu_n+O(\sigma_n)$, we have
\[
 \Pr( A_n=x_n) \sim \frac{\phi\bb{ (x_n-\mu_n)/\sigma_n }}{\sigma_n}
\]
as $n\to\infty$. In the examples considered
here, $Z$ will always be the standard normal distribution $N(0,1)$,
but this is not necessary for the general arguments.  These definitions
extend in a natural way to \emph{bivariate} global and local limit
theorems for sequences $(A_n,B_n)$. In these terms, Theorem~\ref{thprob}
is a bivariate local limit theorem for the pair $(L_1(\Hrnp),N_1(\Hrnp))$.

As usual we say that an event (formally a sequence of events) $E_n$ holds
\emph{with high probability}, or \emph{whp}, if $\Pr(E_n)\to 1$ as $n\to\infty$.
Analogous to the classical 1960 result of Erd\H{o}s and R\'enyi~\cite{ERgiant} for the case of graphs,
in 1985 Schmidt-Pruzan and Shamir~\cite{S-PS} showed that if $r\ge 2$ is constant (which we
assume throughout) and $p=p(n)=\la (r-2)!n^{-r+1}$, then the random hypergraph
$\Hrnp$ undergoes a phase
transition at $\la=1$: for $\la<1$ constant, whp $L_1(\Hrnp)$ is at most a constant
times $\log n$, if $\la=1$ then $L_1(\Hrnp)$ is of order $n^{2/3}$, and if $\la>1$
is constant then whp $L_1(\Hrnp)\ge c_{r,\la} n$ for some constant $c_{r,\la}>0$.
The model studied in~\cite{S-PS} is in fact more general, allowing edges of different
sizes up to $O(\log n)$.

The case where the `branching factor' $\la$ is bounded and bounded away from $1$ is
essentially equivalent to that where $\la>1$ is constant; we shall not distinguish them
in this discussion. Still considering this case, in 2007 Coja-Oghlan, Moore and Sanwalani~\cite{C-OMS}
refined the results of Schmidt-Pruzan and Shamir, finding in particular the asymptotic value $\rho_{r,\la}n$
of $L_1(\Hrnp)$ in the supercritical case, and giving an asymptotic formula
for its variance.
In 2010 Behrisch, Coja-Oghlan and Kang~\cite{BC-OK1} went further when they established
the limiting distribution of $L_1(\Hrnp)$ in the regime $\la>1$ constant:
they used random walk
and martingale methods to establish a central limit theorem, and then
a smoothing technique, combined with multi-round exposure
(ideas that appear in a slightly different form in~\cite{C-OMS}), to deduce
the corresponding local limit theorem. In~\cite{BC-OK2a} they deduced from
this a \emph{bivariate} local limit theorem for $L_1(\Hrnp)$ and $M_1(\Hrnp)$ (equivalent
to one for $L_1(\Hrnp)$ and $N_1(\Hrnp)$)
under the same assumption $\la>1$ constant. This result is directly analogous
to Theorem~\ref{thprob} except that $\eps=\Theta(1)$ rather than $\eps\to 0$,
and, as shown in~\cite{BC-OK2b}, leads to an enumerative result
analogous to Theorem~\ref{thenum}, but for hypergraphs with nullity $\Theta(s)$,
where $s$ is the number of vertices.

Turning to the case where $\la=\la(n)\to 1$, let us write $\la$ as $1+\eps$ with
$\eps=\eps(n)$. Building on enumerative results of theirs~\cite{KL_sparse} from 1997,
in 2002 Karo\'nski and \L uczak~\cite{KL_giant} proved a bivariate local limit theorem
for $L_1(\Hrnp)$ and $N_1(\Hrnp)$ just above the `critical window'
$\eps=O(n^{-1/3})$ of the phase transition, in the range where $\eps^3n\to\infty$
but $\eps^3n=o(\log n/\log\log n)$.
In an extended abstract from 2006, Andriamampianina and Ravelomanana~\cite{AR} outlined
an extension of the enumerative results of Karo\'nski and \L uczak~\cite{KL_sparse} to treat
hypergraphs with much larger excess (or nullity); this implies an extension of the local
limit theorem of~\cite{KL_giant} to the range where $\eps^3n\to\infty$ but $\eps^4n\to 0$.
These results illustrate a general phenomenon in this field: it seems that the barely
supercritical case is more accessible to enumerative methods, and the strongly
supercritical ($\la>1$ constant) to probabilistic methods.

In the special case of graphs, even more detailed results have been proved.
Following many earlier results (see,
for example, the references in~\cite{PWio}), in 2006 Luczak and \L uczak proved a local
limit theorem for $L_1(\Htnp)$ throughout the entire supercritical regime, i.e., when $\la=1+\eps$
with $\eps^3n\to\infty$ and $\eps=O(1)$, as part of a more general result about
the random cluster model. Slightly earlier, Pittel and Wormald~\cite{PWio} had come
very close to proving a \emph{trivariate} local limit theorem for $L_1(\Htnp)$, $N_1(\Htnp)$
and a third parameter, the number of vertices in the `core'.
More precisely, they proved a trivariate local limit theorem for the conditional
distribution of these parameters where
the conditioning is on the event that there
is a unique giant component of approximately the right size, an event that holds
with probability $1-o(1)$. With
hindsight it is easy to remove the conditioning using, for example, Lemma~\ref{lbigep}.
As far as we are aware,
it is an open question whether their trivariate result can be generalized to
hypergraphs, even for $\eps$ constant or $\eps=o(\log n/\log\log n)$.

\smallskip
Returning to hypergraphs, if we ask for results covering the entire (weakly) supercritical
regime $\eps^3n\to\infty$, $\eps\to 0$, it is only recently that anything non-trivial has
been proved about the giant component.
Indeed, as far as we are aware, the first result of this type
is the central limit theorem for $L_1(\Hrnp)$ proved in~\cite{BR_hyp}, using
random walk and martingale arguments. A bivariate central
limit theorem for $L_1(\Hrnp)$ and $N_1(\Hrnp)$ was proved very
recently in~\cite{BR_hyp2}, using similar methods.
Here we shall use smoothing ideas as in~\cite{C-OMS,BC-OK2a}, but applied in a
very different way, to deduce the corresponding bivariate local limit theorem,
Theorem~\ref{thprob}; Theorem~\ref{thenum} will then follow easily.

The methods of Sato and Wormald~\cite{SatoWormald} are extensions
of those of Pittel and Wormald~\cite{PWio} and so, in the range in which
they apply (i.e., $r=3$, and $p=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)\to 0$
but $\eps^4n/\log^{3/2}n\to\infty$), may potentially lead to a trivariate
local limit result for $L_1$, $N_1$ and the number of vertices in the core. As noted above,
whether such a result can be proved throughout the range $\eps\to 0$ but $\eps^3n\to\infty$,
or for $r>3$, is currently open.

\medskip
In the next section we illustrate the basic strategy of our proof of Theorem~\ref{thprob}
by showing how the same idea can be applied in a much simpler setting. Then, in Subsection~\ref{ss_complications},
we describe some of the complications that will arise when we implement this idea to prove Theorem~\ref{thprob}.
Only then, in Subsection~\ref{ss_org}, do we describe the organization of the rest of the paper.
The reason for this is that almost all of the paper is devoted to the proof of Theorem~\ref{thprob},
and our description of the key steps and structure of this proof will only make
sense after the discussion earlier in Section~\ref{sec_example}.
Formally, nothing in Section~\ref{sec_example} is required in the later sections.

\section{Smoothing: a simple example}\label{sec_example}

The following trivial observation captures the intuitive idea
that `local smoothness' is what is needed to pass from a global limit theorem
to the corresponding local one.

\begin{proposition}\label{gtol}
Suppose that a sequence $(A_n)$ of random variables
satisfies a global limit theorem with parameters $\mu_n$ and $\sigma_n$,
and that $\Pr(A_n=x_n)-\Pr(A_n=x_n')=o(1/\sigma_n)$ as $n\to\infty$
whenever $x_n=\mu_n+O(\sigma_n)$ and $x_n-x_n'=o(\sigma_n)$.
Then $(A_n)$ satisfies the corresponding local limit theorem.
\end{proposition}
\begin{proof}
Let $\phi(x)$ be the density function associated to the global limit theorem,
and $\Phi(x)=\int_{y<x} \phi(y) \dy$ the corresponding distribution function.
Fix $C>0$. The global limit theorem says that for any fixed $x\in [-C,C]$ we have
\[
 \Pr(A_n\le \mu_n+x\sigma_n) = \Phi(x) +o(1)
\]
as $n\to\infty$; since $\Phi(x)$ is continuous the same estimate holds uniformly
in $x\in [-C,C]$. Suppose that $|x_n-\mu_n|\le C\sigma_n$ for each $n$.
It follows that if $\delta_n\to 0$ slowly enough, then
\begin{eqnarray*}
 \Pr\bb{ x_n - \delta_n\sigma_n < A_n \le x_n + \delta_n\sigma_n }
 &\sim& \Phi\left(\frac{x_n-\mu_n}{\sigma_n} + \delta_n\right) - \Phi\left(\frac{x_n-\mu_n}{\sigma_n} - \delta_n\right)  \\
 &\sim& 2\delta_n \phi\left(\frac{x_n-\mu_n}{\sigma_n}\right).
\end{eqnarray*}
By assumption all $2\delta_n\sigma_n+O(1)$ values in the interval
$x_n\pm\delta_n\sigma_n$ have probabilities differing by $o(1/\sigma_n)$,
so they are all within $o(1/\sigma_n)$ of their average, which
is $(1+o(1))\phi((x_n-\mu_n)/\sigma_n)/\sigma_n$.
\end{proof}

A standard technique for establishing the smoothness required
by Proposition~\ref{gtol} is to find a `smooth part'
within the distribution of $A_n$.
Given a sequence $(\sigma_n)$ of positive real numbers,
we call a sequence $(\cD_n)$ of sets of probability distributions
on the integers \emph{$\sigma_n$-smooth}
if the following conditions hold whenever $(Y_n)$ is a sequence
of random variables such that the distribution of $Y_n$ is in $\cD_n$:
\begin{equation}\label{smcond}
\hbox{if $x_n-x_n'=o(\sigma_n)$ then $|\Pr(Y_n=x_n)-\Pr(Y_n=x_n')|=o(1/\sigma_n)$.}
\end{equation}

To give a simple example of a smooth sequence, suppose that
$\sigma_n\to\infty$, fix a constant $c>0$,
and let $\cD_n$ be the family of all binomial distributions with variance
at least $c\sigma_n^2$. It is easy to check that $(\cD_n)$ is $\sigma_n$-smooth, for example
directly from the formula for the binomial distribution.
Note that the number of trials in the binomial distributions need not be $n$,
or even $\Theta(n)$.

The following trivial observation describes at a high level the general
strategy that we shall use to prove Theorem~\ref{thprob};
of course there will be many complications to overcome.

\begin{lemma}\label{ss}
Let $(\sigma_n)$ be a sequence of positive reals,
and let $(\cD_n)$ be $\sigma_n$-smooth.
Let $(\cF_n)$ be a sequence of $\sigma$-algebras,
and suppose that we can write $A_n$ as $X_n+Y_n$, where $X_n$ and $Y_n$ are integer-valued,
$X_n$ is $\cF_n$-measurable, and the conditional distribution of $Y_n$ given $\cF_n$ is always
in $\cD_n$.
If $(A_n)$ satisfies a global limit theorem with parameters $\mu_n$
and $\sigma_n$, then $(A_n)$ satisfies the corresponding local limit theorem.
\end{lemma}
\begin{proof}
Suppose that $x_n=\mu_n+O(\sigma_n)$ and $x_n-x_n'=o(\sigma_n)$.
Writing $\Omega_n$ for the probability space on which $A_n$ is defined,
by \eqref{smcond} we have
\begin{multline*}
 \sup_{\Omega_n} \bm{\Pr(A_n=x_n\mid \cF_n) - \Pr(A_n=x_n'\mid \cF_n)} \\
 \le  \sup_{\Omega_n} \sup_{a\in\ZZ} \bm{\Pr(Y_n=a\mid \cF_n) - \Pr(Y_n=a+x_n'-x_n\mid \cF_n)} = o(1/\sigma_n).
\end{multline*}
It follows that $|\Pr(A_n=x_n)-\Pr(A_n=x_n')|=o(1/\sigma_n)$,
so we may apply Proposition~\ref{gtol}.
\end{proof}

This `smooth part' technique is easiest to apply in the case of sums
of independent variables; in this setting McDonald~\cite{McDonald}
used it with each $\cD_n$ consisting of a single
binomial distribution with appropriate parameters. Similar ideas in a combinatorial
setting were used by Scott and Tateno~\cite{ScottTateno}. Behrisch, Coja-Oghlan and Kang~\cite{BC-OK1}
used it to prove the special case of Theorem~\ref{thL1only} where $\eps=\Theta(1)$, with the
$\sigma$-algebra $\cF_n$ corresponding to the first part of a multi-round exposure
of the edges of $\Hrnp$. This particular decomposition cannot be used to prove
Theorem~\ref{thL1only}, since the variance of the relevant variable $Y_n$ is
too small when $\eps\to 0$; we return to this later.

As a simple warm-up for our main result let us outline how Lemma~\ref{ss} may be
applied to the variable $A_n=L_1(G_n)$ where $G_n=\Htnp=G(n,p)$ is the standard
Erd\H{o}s--R\'enyi (binomial) random graph with $p=p(n)=\la/n$
with $\la>1$ constant. Since the result here is not new, and our aim
is to illustrate in a simple setting some of the ideas we shall use later,
we shall assume the following fact without proof.
Recall that the \emph{$2$-core}, or simply \emph{core}, $C(G)$
of a graph $G$, introduced in~\cite{BBkcore}, is the maximal subgraph with minimum degree at least~2.

\begin{proposition}\label{factone}
Let $\la>1$ be constant. There is a constant $c=c(\la)>0$ such that
$G_n=G(n,\la/n)$ has the following properties with probability
$1-o(n^{-1/2})$: the core $C(G_n)$
of $G_n$ has a unique component $\cC_1$ with at least $cn$ vertices, and
this component $\cC_1$ is a subgraph of the largest component of $G_n$;
furthermore, $G_n$ has at least $cn$ isolated vertices.\noproof
\end{proposition}

Of course, the last part above is trivial. Here then is our illustration
of smoothing for the Erd\H os--R\'enyi model, in the simple case
of constant branching factor.

\begin{theorem}\label{th_eg}
Let $p=p(n)=\la/n$ where $\la>1$ is constant, set $G_n=G(n,p)$
and let $A_n=L_1(G_n)$. If $(A_n)$ satisfies a global limit theorem
with $\sigma_n=\Theta(\sqrt{n})$ then it satisfies the corresponding
local limit theorem.
\end{theorem}
Both the global (central) limit theorem and the local limit theorem
are known in this case; the central limit theorem
was established by Pittel and Wormald~\cite{PWio} and the local one
by Luczak and \L uczak~\cite{LuczakLuczak}; our aim here is to show how one can deduce one
from the other.
\begin{proof}
Given any graph $G$, let $G^-$ be the \emph{reduced graph}
obtained from $G$ by deleting all pendent edges incident
with the core $C(G)$ of $G$.
In other words, $G^-$ is the spanning
subgraph of $G$ obtained by deleting those edges
$e=vw$ in which $v$ has degree 1 and $w$ is in $C(G)$.
Note that $G$ and $G^-$ have the same core.
It follows that if $H$ is any graph that can arise as $G^-$ for some $G$,
then a graph $G$ with $V(G)=V(H)$ has $G^-=H$ if and only if $G$
is formed from $H$ in the following way:
for each isolated vertex $v$ of $H$, either
do nothing, or add an edge from $v$ to some vertex $w$ of the core $C(H)$ of $H$.
Since the probability of a graph $G$ in the model $G(n,p)$
is proportional to $(p/(1-p))^{e(G)}$, it follows that for any graph $H$
whose core $C(H)$ has $m$ vertices,
the conditional distribution of $G_n=G(n,p)$ given that $G_n^-=H$
may be described as follows:

\smallskip
for each isolated vertex $v$ of $H$, with probability $pm/(pm+1-p)$ pick
a uniformly random vertex $w$ of $C(H)$ and join $v$ to $w$; otherwise do nothing. The
decisions associated to different $v$ are independent.

\smallskip
Let $\cF_n$ be the $\sigma$-algebra generated by the random variable $G_n^-$,
let $X_n$ be the number of vertices in the component of $H=G_n^-$ containing
the largest component $\cC_1$ of its core (chosen according to any
fixed rule if there is a tie), and let $Y_n$
be the number of vertices `rejoined' \emph{to this component $\cC_1$} when constructing
$G_n$ from $G_n^-$ as above.
Let $A_n'=X_n+Y_n$, noting that whenever $\cC_1$
is a subgraph of the largest component of $G_n$, we have $A_n'=L_1(G_n)$.
Clearly, $X_n$ is $\cF_n$-measurable.
Moreover, from the independence over vertices $v$,
the conditional distribution of $Y_n$ given $\cF_n$ is the binomial
distribution $\Bi(i(G_n^-),\pi)$ where $i(H)$ denotes the number
of isolated vertices of a graph $H$ and
$\pi=\pi(G_n^-)=p|\cC_1|/(p|C(G_n^-)|+1-p)$.

Let $c>0$ be the constant appearing in Proposition~\ref{factone}.
Let $E_n$ be the event that the core $C(G_n)=C(G_n^-)$ has a unique component
with at least $cn$ vertices, and that $i(G_n^-)\ge cn$.
Note that $E_n\in \cF_n$. Also, since $i(G_n^-)\ge i(G_n)$,
by Proposition~\ref{factone} we have $\Pr(E_n)=1-o(n^{-1/2})$.
Whenever $E_n$ holds we have $c\le p|\cC_1|\le p|C(G_n^-)|=O(1)$ so, since $1-p\sim 1$,
the probability $\pi$ is bounded away from $0$ and $1$.
Hence, since $i(G_n^-)\ge cn$, the variance $i(G_n^-)\pi(1-\pi)$
of the (binomial) conditional distribution of $Y_n$ is at least $an$ for some constant $a>0$.
Letting $\cD_n$ be the family of all binomial distributions
with variance at least $an$, then whenever $E_n$ holds,
the conditional distribution of $Y_n$ given $\cF_n$ is in $\cD_n$.
As noted above, the sequence $(\cD_n)$ is $\sqrt{n}$-smooth.

Recall that $A_n'=X_n+Y_n$ is the number of vertices
in the component of $G_n$ containing the largest component $\cC_1$ of $C(G_n)=C(G_n^-)$ (chosen according
to any fixed rule if there is a tie) so, by Proposition~\ref{factone}, $A_n'=L_1(G_n)$ with probability
at least $1-o(n^{-1/2})$.
Since $E_n$ holds whp, the conditional
distribution of $A_n'$ given $E_n$ satisfies the same global limit
theorem as the unconditional distribution of $A_n=L_1(G_n)$ does;
let $\mu_n$ and $\sigma_n=\Theta(\sqrt{n})$ be the parameters of this global limit theorem, and $\phi$ the
associated limiting density function.
Having conditioned on $E_n$, we now condition on $\cF_n$
as above and apply Lemma~\ref{ss}, using the fact that $(\cD_n)$ is $\sqrt{n}$-smooth.
We obtain the result that for any $x_n$ satisfying $x_n-\mu_n=O(\sqrt{n})$ we have
\[
 \Pr(A_n'=x_n\mid E_n) = \frac{\phi\bb{(x_n-\mu_n)/\sigma_n}}{\sigma_n} + o(n^{-1/2}).
\]
Since $\Pr(E_n)=1-o(n^{-1/2})$ and $\Pr(A_n'\ne A_n)=o(n^{-1/2})$ we have
$\Pr(A_n=x_n)=\Pr(A_n'=x_n\mid E_n)+o(n^{-1/2})$, giving the result.
\end{proof}

\subsection{Smoothing in the proof of Theorem~\ref{thprob}}\label{ss_complications}

In the rest of the paper we shall use a version of the above
technique to prove Theorem~\ref{thprob}. Since this proof is rather
long, and on reading (or writing!) it for the first time one might wonder
why it is so complicated, let us first outline some of the problems
that occur when adapting the proof of Theorem~\ref{th_eg}.
Some of these concern the transition from graphs to hypergraphs,
some arise when allowing $\eps\to 0$, and some concern the extension
to a bivariate result. It is allowing $\eps\to 0$ that turns out to
cause the most difficulty.

Firstly, it turns out that (in both the graph and hypergraph cases)
the number of vertices of degree $1$ joined
directly to the core is $\Theta(\eps^2 n)$.  This means that the
variance obtained by deleting and reattaching such vertices will be
$\Theta(\eps^2 n)$, which is much smaller than the variance
$\Theta(n/\eps)$ of $L_1=L_1(\Hrnp)$ when $\eps\to 0$.  For this reason we need
to remove and reattach larger trees; indeed, it turns out that we need
to consider trees up to size $\Theta(\eps^{-2}$), which is essentially
the largest size that appears. (The bulk of the variance comes from
the large trees.) This complicates things, since each
tree contributes a different number of vertices to the giant
component.

Secondly, there are various `good events' $E$ that we need to hold
for various parts of our smoothing argument.
As in the simple example above, one is that the core is
not too much smaller than it should be, and another is that the largest component
of the core is contained in the largest component of the whole
graph. Some of the bad events $E^\cc$ turn out to have probability
$\exp(-\Theta(\eps^3 n))$ (since the core is really characterized by
the kernel, which has $\Theta(\eps^3 n)$ vertices). So if $\eps^3n\to\infty$ slowly,
the unconditional probabilities of these events may be much larger than the probabilities
such as $\Pr(L_1=x_n)=\Theta(\sqrt{\eps/n})$ that we wish to estimate. The solution
is to show that $\Pr(E\mid L_1=x_n)=1-o(1)$, so
$\Pr(L_1=x_n) \sim \Pr(\{L_1=x_n\} \cap E)$. Then we can effectively
condition on $E$ (though being careful to keep independence where it is needed).

Thirdly, unlike for graphs, in the hypergraph case, even the simple
operation of deleting all `pendant edges' attached to the core (i.e.,
hyperedges with one vertex in the core and the other vertices
in no other hyperedges) is not so simple to invert. The inverse
involves selecting \emph{disjoint} sets of $r-1$ isolated vertices
to rejoin to the core. The condition that the sets must be disjoint
means that the number that do rejoin no longer has a binomial distribution.
We deal with this by randomly \emph{`marking'} some vertices throughout
the graph. Roughly speaking, we detach pendant edges attached either
to the core or to marked vertices, meaning that we remember
that a certain $(r-1)$-tuple was attached either to the core
or to a marked vertex. Then all choices of \emph{where} to reattach
the tuples do turn out to be independent. Of course, we actually detach larger
trees, not just pendant edges. In fact, rather than consider individual
trees, we shall study in one go the
forests attached to the core and to a suitable set of marked vertices.

Finally, for the bivariate result we need to show that $N_1$ also has a smooth
distribution; for this we use the same basic smoothing technique applied in a
different (and much simpler) way than for $L_1$. Fortunately, since
our smoothing argument for $L_1$ involves operations on the hypergraph
that do not affect the nullity of the largest component, these two
separate smoothing arguments combine to give the \emph{joint} smoothness
of $L_1$ and $N_1$ needed to prove Theorem~\ref{thprob}.

One might wonder whether our approach is really easier than (or indeed
different from) proving a local limit theorem directly.  Whether or not it is easier, the
fact remains that the local limit theorem was previously only known for restricted
ranges of the key parameter $\eps(n)$.  As to whether the approaches are genuinely
different, we believe that the answer is `yes'.  A key observation is that we study only
\emph{part} of the variation in the size of the giant component. The general method means
that, writing $\sigma_n^2$ for the variance of the quantity ($L_1$ or $N_1$)
we are studying, our `smoothing distribution' needs variance $\Theta(\sigma_n^2)$, but it can be an
arbitrarily small constant times $\sigma_n^2$.  This is vital since it means that in many of
our estimates we have a constant
factor elbow room.  This is unlikely to be the case in any direct proof of the local limit theorem,
since it would
lead to a significant error in the variance of $L_1$ or $N_1$. Here the variances of $L_1$
and $N_1$ are part
of the \emph{input} (the global limit assumption), and we really are establishing only
smoothness, rather than reevaluating the whole distribution.

\subsection{Organization of the rest of the paper}\label{ss_org}

The rest of the paper is organized as follows.
In Section~\ref{sec_key} we state two results from~\cite{BR_hyp2} that we shall need;
one of these is the global (central) limit theorem corresponding to Theorem~\ref{thprob}.
Then we state two key intermediate results, Theorems~\ref{thexcess} and~\ref{thL1}.
The first establishes smoothness of $N_1$, showing (a little more than) that
nearby values have almost equal probabilities. The second establishes (essentially) smoothness of the
distribution of $L_1$ conditional on $N_1$; as we note in the next section, these
results easily imply Theorem~\ref{thprob}.

In Section~\ref{sec_mr} we prove Theorem~\ref{thexcess}, using multi-round exposure arguments
reminiscent of those used by Behrisch, Coja-Oghlan and Kang~\cite{BC-OK2a}. In the subsequent
sections we prepare the ground for the (much more complicated) proof of Theorem~\ref{thL1}.
First, in Section~\ref{sec_tc} we present a result of Selivanov~\cite{Selivanov} enumerating hypergraph forests
subject to certain constraints, and a simple consequence concerning random forests. Then, in
Section~\ref{sec_dist}, we use Selivanov's formula to show that a certain distribution
associated to detaching and reattaching forests from the core and `marked' vertices
is $\sqrt{n/\eps}$-smooth as defined earlier in this section, so it can play
the role of $Y_n$ above when studying the distribution of $L_1$.
Next, in Section~\ref{sec_dual}, we
state a precise form of the supercritical/subcritical duality result for the random hypergraph $\Hrnp$;
in Section~\ref{sec_sub} we use this to establish some properties of the `small' components of $\Hrnp$
that we shall need later. In Section~\ref{sec_ext} we formally define `marked vertices'
and the extended core of
$\Hrnp$, and show that with high conditional probability it has the properties we need.
After this preparation, in Section~\ref{sec_main} we prove Theorem~\ref{thprob};
in Section~\ref{sec_deduce} we show that Theorem~\ref{thenum} follows.
Finally, in the Appendix we give detailed calculations comparing our formulae
with those in~\cite{BC-OK2pre,BC-OK2abs,BCMcK,KL_sparse,SatoWormald}.

\section{The key ingredients}\label{sec_key}

In this section we state two results from~\cite{BR_hyp2} that we shall need
as `inputs' to our smoothing arguments. Then we state our two main intermediate
results, and show how they combine to give Theorem~\ref{thprob}.

\subsection{Inputs}

Building on methods used in~\cite{BR_hyp} to prove the central limit
theorem for $L_1=L_1(\Hrnp)$,
in~\cite{BR_hyp2} we proved the following bivariate (global) central limit theorem
for the order $L_1$ and nullity $N_1$ of the largest component of $\Hrnp$.
Here, and throughout, $\rho_{r,\la}$ and $\rho_{r,\la}^*$ are as defined in \eqref{rkldef}
and \eqref{rhosdef}.

\begin{theorem}\label{thglobal2}
Let $r\ge 2$ be fixed, and let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)\to 0$
and $\eps^3n\to\infty$. Let $L_1$ and $N_1$ be the order and nullity of the largest
component $\cL_1$ of $\Hrnp$. Then
\[
 \left( \frac{L_1-\rho_{r,\la}n}{\sqrt{2n/\eps}} ,
  \frac{N_1-\rho_{r,\la}^*n}{\sqrt{10/3}(r-1)^{-1}\sqrt{\eps^3 n}} \right)
\dto (Z_1,Z_2),
\]
where $\dto$ denotes convergence in distribution, and $(Z_1,Z_2)$
has a bivariate Gaussian distribution
with mean~$0$, $\Var[Z_1]=\Var[Z_2]=1$ and $\Covar[Z_1,Z_2]=\sqrt{3/5}$.\noproof
\end{theorem}

In particular, recalling \eqref{newrasympt}, $L_1$ is asymptotically Gaussian with mean
$\Theta(\eps n)$ and variance $\Theta(n/\eps)$,
and $N_1$ is asymptotically Gaussian with mean $\Theta(\eps^3n)$ and variance $\Theta(\eps^3 n$).

In Section~\ref{sec_mr} we shall need the following large-deviation bounds on $L_1$
and $L_2$, the order of the second largest component of $\Hrnp$; this result is
also proved in~\cite{BR_hyp2}.

\begin{theorem}\label{thsupertail}
Let $r\ge 2$ be fixed, and let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=O(1)$
and $\eps^3n\to\infty$. If $\omega=\omega(n)\to\infty$ and
$\omega=O(\sqrt{\eps^3n})$ then
\[
 \Pr\Bb{ |L_1(\Hrnp)-\rho_{r,\la} n| \ge \omega\sqrt{n/\eps} } = \exp(-\Omega(\omega^2)).
\]
Moreover, if $L=L(n)$ satisfies $\eps^2L\to\infty$ and $L=O(\eps n)$, then
\[
 \Pr( L_2(\Hrnp) > L ) \le C \frac{\eps n}{L} \exp(-c \eps^2L),
\]
for some constants $c,C>0$.%
\noproof
\end{theorem}

\subsection{Main steps}

Theorem~\ref{thprob} is the bivariate local limit version of Theorem~\ref{thglobal2}.
To deduce it from Theorem~\ref{thglobal2}, we must show that `nearby' potential
values of the pair $(L_1,N_1)$ have essentially the same probability. We proceed
in two stages. In the first, we show that $N_1$ has a smooth distribution,
which will already allow us to prove Theorem~\ref{thN1}.
More precisely,
we shall prove the following result in Section~\ref{sec_mr}.
In this result we consider the pair $(L_1-(r-2)N_1,N_1)$
rather than the pair $(L_1,N_1)$, for technical reasons that will become clear
during the proof; this makes little difference, since the
standard deviation of $N_1$ is much smaller than that of $L_1$.

\begin{theorem}\label{thexcess}
Let $r\ge 2$ be fixed, and let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)=O(1)$
and $\eps^3n\to\infty$. For any sequences $(t_n)$ and $(t_n')$ with
$t_n,t_n'\ge 0$ and $t_n-t_n'=o(\sqrt{\eps^3n})$, and any $I_n\subset\ZZ$,
we have
\begin{multline*}
 \Pr\bb{ N_1=t_n\hbox{ and }L_1-(r-2)N_1\in I_n } - \Pr\bb{ N_1=t_n'\hbox{ and }L_1-(r-2)N_1\in I_n } \\
 = o((\eps^3n)^{-1/2}).
\end{multline*}
\end{theorem}

By Proposition~\ref{gtol}, Theorems~\ref{thglobal2} and~\ref{thexcess} imply Theorem~\ref{thN1}.
Indeed, Theorem~\ref{thglobal2} immediately implies that $N_1=N_1(\Hrnp)$
satisfies a central limit theorem with parameters $\rho^*_{r,\la}n$ for the mean
and $\sigma_n^*=\sqrt{10/3}(r-1)^{-1}\sqrt{\eps^3n}$ for the standard deviation.
Since $\sigma_n^*=\Theta(\sqrt{\eps^3n})$,
taking $I_n=\ZZ$ in Theorem~\ref{thexcess} we see that if $t_n-t_n'=o(\sigma_n^*)$
then $\Pr(N_1=t_n)-\Pr(N_1=t_n')=o(1/\sigma_n^*)$. Hence Theorem~\ref{thN1}
follows by Proposition~\ref{gtol}.

In the next result, and much of the rest of the paper, we only consider potential
values of $L_1$ in a `typical' range. To be precise,
let $\delta=\delta(n)$ satisfy
\begin{equation}\label{deltadef}
 \delta\to 0\hbox{\quad and\quad}\delta\ge (\eps^3n)^{-1/3},
\end{equation}
and let
\begin{equation}\label{rangedef}
 \range = \range_n =\range_{n,p} = [(1-\delta)\rho_{r,\la}n, (1+\delta)\rho_{r,\la}n].
\end{equation}
By Theorem~\ref{thsupertail}, applied with
$\omega=\delta\rho_{r,\la}n/(\sqrt{n/\eps})=\Theta(\delta\sqrt{\eps^3n})$, under
our Weak Assumption~\ref{A1} we have
\begin{equation}\label{rangewvhp}
 \Pr(L_1(\Hrnp)\notin\range) \le \exp(-c\delta^2\eps^3n)
 \le \exp(-c(\eps^3n)^{1/3}) = O(1/(\eps^3 n)).
\end{equation}

The bulk of the paper will be devoted to the proof of the following result establishing,
essentially, smoothness of the conditional distribution of $L_1$ given~$N_1$.

\begin{theorem}\label{thL1}
Let $r\ge 2$ be fixed, let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$
where $\eps=\eps(n)$ satisfies $\eps\to 0$ and $\eps^3 n\to\infty$,
and set $L_1=L_1(\Hrnp)$. Define $\range=\range_n$ as in \eqref{rangedef}.
If $(x_n)$, $(y_n)$ and $(t_n)$ are sequences of integers with
$x_n,y_n\in \range_n$, $x_n-y_n=o(\sqrt{n/\eps})$, $t_n\ge 2$, and
\[
 x_n \equiv  y_n \equiv 1-t_n \hbox{\quad modulo }(r-1),
\]
then
\[
 \Pr(L_1=x_n, N_1=t_n)-\Pr(L_1=y_n, N_1=t_n) = o(1/(\eps n)).
\]
\end{theorem}

Theorems~\ref{thexcess} and Theorem~\ref{thL1} will be proved in Sections~\ref{sec_mr}--\ref{sec_main}.
First, let us show how they imply Theorem~\ref{thprob}. Although the argument is straightforward,
since Theorem~\ref{thL1} is our main result, we shall spell out the details.

\begin{proof}[Proof of Theorem~\ref{thprob}]
Throughout we fix $r\ge 2$, and a function $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ such that $\eps=\eps(n)$
satisfies $\eps\to 0$ and $\eps^3n\to\infty$.
Let
\[
 \sigma_n=\sqrt{2n/\eps}\hbox{\qquad and\qquad}
  \sigma_n^*=\sqrt{10/3}(r-1)^{-1}\sqrt{\eps^3n}=\Theta(\sqrt{\eps^3n}).
\]
Indicating the dependence on $n$ for once, let $L_{1,n}=L_1(\Hrnp)$ and
$N_{1,n}=N_1(\Hrnp)$. It will be convenient to consider
the linear combination
\[
 \tL_{1,n}=L_{1,n}-(r-2)N_{1,n}.
\]
Since $\sigma_n^*=o(\sigma_n)$, setting $\trho_{r,\la}=\rho_{r,\la}-(r-2)\rho^*_{r,\la}$,
Theorem~\ref{thglobal2} immediately implies that
\begin{equation}\label{ctilde}
 \left( \frac{\tL_{1,n}-\trho_{r,\la}n}{\sigma_n} ,
  \frac{N_{1,n}-\rho_{r,\la}^*n}{\sigma_n^*} \right)
\dto (Z_1,Z_2),
\end{equation}
where $(Z_1,Z_2)$
has a bivariate Gaussian distribution
with mean~$0$, $\Var[Z_1]=\Var[Z_2]=1$ and $\Covar[Z_1,Z_2]=\sqrt{3/5}$;
the probability density function $f(a,b)$ of this distribution is given in \eqref{pdf}.

Suppose that $x_n=\rho_{r,\la}n+O(\sigma_n)$
and $y_n=\rho^*_{r,\la}n+O(\sigma^*_n)$; our aim is to prove \eqref{pointprob}
for these sequences. By a standard subsequence argument, we may assume without
loss of generality that
\[
 \frac{x_n-\rho_{r,\la}n}{\sigma_n}\to x
\hbox{\qquad and\qquad}
  \frac{y_n-\rho_{r,\la}^*n}{\sigma^*_n}\to y
\]
for some $x,y\in \RR$.
Since the density $f(a,b)$ is bounded away from 0 on compact sets, what
we must show is exactly that
\begin{equation}\label{aimo1}
 \Pr\bb{ L_{1,n}=x_n,\, N_{1,n}=y_n } = \frac{(r-1)f(x,y)+o(1)}{\sigma_n\sigma^*_n}.
\end{equation}

It will be convenient to consider more explicit reformulations of Theorems~\ref{thexcess} and~\ref{thL1}.
By Theorem~\ref{thexcess}, for every constant $\alpha>0$ there is a constant $\beta>0$
and an integer $n_0$ such that the following holds:
whenever $n\ge n_0$, $|t-t'|\le \beta\sigma_n^*$ and $I\subset \ZZ$,
then
\begin{equation}\label{eref}
 \bigl|\Pr\bb{ N_{1,n}=t,\, \tL_{1,n}\in I } - \Pr\bb{ N_{1,n}=t',\, \tL_{1,n}\in I } \bigr| \le  \alpha/\sigma_n^*.
\end{equation}
Indeed, if \eqref{eref} does not hold, then picking an $\alpha$ for which it fails,
for each $k$ we may find an $n_k>n_{k-1}$ and $I_{n_k}$, $t_{n_k}$ and $t_{n_k}'$
such that $|t_{n_k}-t_{n_k}'|\le \sigma_n^*/k$ and
$\Pr\bb{N_{1,n_k}=t_{n_k},\, \tL_{1,n_k}\in I_{n_k}}$ and
$\Pr\bb{N_{1,n_k}=t_{n_k}',\, \tL_{1,n_k}\in I_{n_k}}$ differ by at least $\alpha/\sigma_n^*$.
Completing the sequences $t_n$, $t_n'$ and $I_n$ appropriately gives a counterexample
to Theorem~\ref{thexcess}.

Let $\eta>0$ be constant. We shall show that if $n$ is large enough, then
\begin{equation}\label{aimeta}
 \left| \Pr\bb{ L_{1,n}=x_n,\, N_{1,n}=y_n } - \frac{(r-1)f(x,y)}{\sigma_n\sigma^*_n} \right|
 \le \frac{3r\eta}{\sigma_n\sigma^*_n},
\end{equation}
proving \eqref{aimo1} and thus Theorem~\ref{thprob}.

Let $C=\max\{|x|,|y|\}+1$. Note that for all large enough $n$ we have
$|x_n-\rho_{r,\la}n|\le C\sigma_n$ and $|y_n-\rho^*_{r,\la}n|\le C\sigma^*_n$.
Also, if $n$ is large enough, then the set $\range=\range_n$ defined in \eqref{rangedef}
contains $[\rho_{r,\la}n-C\sigma_n,\rho_{r,\la}n+C\sigma_n]$. Hence Theorem~\ref{thL1} implies
that there are $\gamma_1>0$ and $n_0$ such that whenever $n\ge n_0$, $t\ge 2$,
$s$ and $s'$ are within $C\sigma_n$ of $\rho_{r,\la}n$, $|s-s'|\le \gamma_1\sigma_n$ and
$s\equiv s'\equiv 1-t$ modulo $r-1$, then
\begin{equation}\label{vref}
  \bigl|\Pr(L_{1,n}=s,\, N_{1,n}=t)-\Pr(L_{1,n}=s',\, N_{1,n}=t)\bigr| \le \frac{\eta}{\sigma_n\sigma^*_n}.
\end{equation}

Since $f(\cdot,\cdot)$ is continuous at $(x,y)$, we may choose $\gamma_2>0$ such that whenever $|a-x|\le \gamma_2$
and $|b-x|\le \gamma_2$ then $|f(a,b)-f(x,y)|\le \eta$. Set $\gamma=\min\{\gamma_1,\gamma_2\}$
and let
\[
 I_n=[\trho_{r,\la}n+(x-\gamma/2)\sigma_n,\, \trho_{r,\la}n+(x+\gamma/2)\sigma_n].
\]
For each $n\ge 1$ and $t\ge 0$ let
\[
 \pi_{n,t} = \Pr\bb{ N_{1,n}=t,\, \tL_{1,n}\in I_n }.
\]
By \eqref{eref}, applied with $\alpha=\eta\gamma$, there is a constant $\beta>0$,
which we may assume to be less than $\gamma_2$, such that for all large enough $n$
we have
\begin{equation}\label{pidiff}
 | \pi_{n,t} - \pi_{n,t'} |  \le  \eta\gamma/\sigma_n^*
\end{equation}
whenever $t,t'$ lie in the interval
\[
 J_n=[\rho_{r,\la}^*n+(y-\beta/2)\sigma^*_n,\, \rho_{r,\la}^*n+(y+\beta/2)\sigma^*_n].
\]
Let
\[
 a_n = \frac{1}{|J_n|} \sum_{t\in J_n} \pi_{n,t}
 = \frac{1}{|J_n|} \Pr\left( (\tL_{1,n},N_{1,n}) \in I_n\times J_n \right).
\]
Since $\sigma^*_n\to\infty$ and $\beta$ is constant, we have $|J_n|\sim \beta\sigma^*_n$.
It follows from \eqref{ctilde} that
\[
 a_n \sim \frac{1}{\beta\sigma^*_n}
   \int_{a=x-\gamma/2}^{x+\gamma/2} \int_{b=y-\beta/2}^{y+\beta/2} f(a,b) \,\da\,\db.
\]
Since $\beta$ and $\gamma$ are at most $\gamma_2$, for all $(a,b)$ in the
region of area $\beta\gamma$ over which we integrate we have $|f(a,b)-f(x,y)|\le \eta$.
Hence, for $n$ large enough,
\[
 |a_n-f(x,y)\gamma/\sigma^*_n| \le 2\eta\gamma/\sigma^*_n.
\]

Now $a_n$ is the average of the values $\pi_{n,t}$ over $t\in J_n$, so the bound \eqref{pidiff} implies
that all of these values are within $\eta\gamma/\sigma^*_n$ of $a_n$.
For $n$ large enough, $y_n\in J_n$, so
\begin{equation}\label{pyn}
 |\pi_{n,y_n} -f(x,y)\gamma/\sigma^*_n |\le 3\eta\gamma/\sigma_n^*.
\end{equation}

Since the component of $\Hrnp$ with $L_{1,n}$ vertices and nullity $N_{1,n}$ is by definition
connected, \eqref{nulldef} gives $L_{1,n}+N_{1,n}\equiv 1$ modulo $r-1$. Hence
\begin{equation}\label{pisum}
 \pi_{n,y_n} = \Pr\bb{N_{1,n}=y_n,\, L_{1,n}-(r-2)y_n\in I_n}
 = \sum_{s\in S_n} \Pr\bb{L_{1,n}=s,\,N_{1,n}=y_n}
\end{equation}
where $S_n$ consists of all integers in $I_n+(r-2)y_n$ congruent to $1-y_n$ modulo $r-1$.
Hence
\begin{equation}\label{Ssize}
 |S_n| = \frac{|I_n|}{r-1}+O(1) = \frac{\gamma\sigma_n}{r-1}+O(1) \sim \frac{\gamma\sigma_n}{r-1}.
\end{equation}
Since $x_n=\rho_{r,\la}n+x\sigma_n+o(\sigma_n)$ and $y_n=\rho^*_{r,\la}n+O(\sigma_n^*)
=\rho^*_{r,\la}n+o(\sigma_n)$, for $n$ large enough we have $x_n\in S_n$.
Furthermore, all $s\in S_n$ are within $C\sigma_n$ of $\rho_{r,\la}n$.
It follows by \eqref{vref} that the probabilities summed in \eqref{pisum} are all within
$\eta/(\sigma_n\sigma_n^*)$ of each other and hence of their average, which by \eqref{pyn}
and \eqref{Ssize} is within $3r\eta/(\sigma_n^*\sigma_n)$ of $(r-1)f(x,y)/(\sigma_n\sigma_n^*)$.
Since $x_n\in S_n$ this concludes the proof of \eqref{aimeta}
and hence that of Theorem~\ref{thprob}.
\end{proof}

\section{Smoothing the excess: multi-round exposure}\label{sec_mr}

In this section we prove Theorem~\ref{thexcess}. The arguments in this section do
not obviously simplify in the case $\eps\to 0$, so throughout we work with
our Weak Assumption~\ref{A1}, i.e.,
we let $p=p(n)=(1+\eps)(r-2)!n^{-r+1}$
where $\eps=\eps(n)$ satisfies $\eps=O(1)$ and $\eps^3 n\to\infty$.

Set
\[
 p_1=(1+\eps/2) (r-2)! n^{-r+1}
\]
and define $p_2$ by $p=p_1+p_2-p_1p_2$, noting that
\begin{equation}\label{p2sim}
 p_2\sim (\eps /2)(r-2)! n^{-r+1} = \Theta(\eps n^{-r+1}).
\end{equation}
Using a now standard idea originally due to Erd\H os and R\'enyi~\cite{ERgiant}, we shall view $\Hrnp$ as $H_1\cup H_2$
where $H_1$ and $H_2$ are independent, and $H_i$ has the distribution $\Hrnpi$.
To prove Theorem~\ref{thexcess} we first `reveal' (i.e., condition on) $H_1$. Then we reveal many but not
all edges of $H_2$. We do this in such a way that the remaining edges of $H_2$ must be of a simple
type. We then show that the conditional number of these edges present is essentially binomial. Since
each will contribute $1$ to $n(\Hrnp)$, this will allow us to prove the result. The strategy is inspired
by a related argument of Behrisch, Coja-Oghlan and Kang~\cite{BC-OK1},
itself based on ideas of Coja-Oghlan, Moore and Sanwalani~\cite{C-OMS}, though the details
are very different since the objective is different. (Their argument is used to
`smooth' $L_1$ rather than $N_1$, and requires  $\eps$ bounded away from zero.)

\begin{proof}[Proof of Theorem~\ref{thexcess}]
Define $p_1$, $p_2$, $H_1$ and $H_2$ as above, and set
\[
 \sigma_0= \sqrt{\eps^3n}.
\]
(Recall that, up to a constant factor, $\sigma_0^2$ is the variance of $N_1(\Hrnp)$.)
We shall first apply Theorem~\ref{thsupertail} to $H_1$, noting that $(\eps/2)^3n\to\infty$.
Since $\rho_{r,1+\eps/2}=\Theta(\eps)$, by Theorem~\ref{thsupertail} there is a constant $c>0$ such that
if $\cE_1$ is the event that $L_1(H_1)\ge c\eps n$, then
\[
 \Pr( \cE_1^\cc) \le \exp(-\Omega(\eps^3n)) = o( 1/\sigma_0).
\]
By the last part of Theorem~\ref{thsupertail},
\[
 \Pr( L_2(\Hrnp) \ge c\eps n) \le \exp(-\Omega(\eps^3n)) = o( 1/\sigma_0).
\]
Let $\cE_2$ be the event that the largest component of $H_1$ is contained in the
largest component $\cL_1$ of $\Hrnp=H_1\cup H_2$. Since $H_1\subset\Hrnp$,
we have
\[
 \Pr(\cE_2^\cc) \le \Pr(\cE_1^\cc) + \Pr(L_2(\Hrnp)\ge c\eps n) =o(1/\sigma_0).
\]
Let $i(H)$ denote the number of isolated vertices in a hypergraph $H$.
It is easy to see that $\E[i(\Hrnp)]=\Theta(n)$. Let $c'$ be a constant
such that $\E[i(\Hrnp)]\ge 2c'n$ for large enough $n$,
and let $\cE_3$ be the event that $i(\Hrnp)\le c'n$. Then standard concentration
arguments show that
\[
 \Pr(\cE_3^\cc) = \exp(-\Omega(n)) =o(1/\sigma_0).
\]

Reveal all edges of $H_1$, and let $\cC$ be the component of $H_1$ with the most vertices
(chosen according to any rule if there is a tie). We shall reveal some partial information
about $H_2$ in a two-step process.

First, test $r$-sets (i.e., potential edges) for their presence in $H_2$ according
to the following algorithm: if there is any untested $r$-set $e$ which does not consist of two
vertices in $\cC$ and $r-2$ vertices that are isolated in the current hypergraph $H$,
then pick some such $r$-set $e$ and test whether it is present in $H_2$. Otherwise, stop.
By the `current hypergraph' we mean
the hypergraph formed by the edges revealed so far, so $H_1\subset H\subset H_1\cup H_2=\Hrnp$.

Let $H$ be the hypergraph revealed at the end of the algorithm,
let $\cI$ be the set of isolated vertices of $H$, and let $U$ be the set of untested $r$-sets
when the algorithm stops. Then $U$
has a very simple form: it consists precisely of all $\binom{|\cC|}{2}\binom{|\cI|}{r-2}$
$r$-sets with two vertices in $\cC$ and $r-2$ in $\cI$.
To see this, note first that if there were any untested $r$-set not of this form, the algorithm
would not have stopped. Conversely, since any isolated vertices in the final hypergraph $H$ were isolated
throughout the running of the algorithm, and $\cC$ (a component of $H_1$, \emph{not}
of the current graph) does not change as the algorithm runs,
any $r$-set of this form cannot have been tested.

At this point, each untested edge is present independently with conditional probability $p_2$.

In the second step, we
reveal the set $F$ of edges $e$ in $U$ present in $H_2$ with the property that some vertex
of $e\cap \cI$ is incident with one or more other edges of $H_2$. Let $\cI'$
be the set of vertices in $\cI$ not incident with edges in $F$.

Let $\cF$ denote the the $\sigma$-algebra generated by all the information revealed so far,
and let $F'$ be the set of edges of $H_2$ not yet revealed. Then $F'$ consists of edges
with two vertices in $\cC$ and $r-2$ in $\cI'$, with the corresponding subsets of $\cI'$
disjoint. Further more, given $\cF$ (which determines $\cC$ and $\cI'$),
any set $F'$ of edges satisfying this description is possible.

Let $\cE$ be the event
\[
 \cE= \{  |\cC|\ge c\eps n \hbox{ and } |\cI'|\ge c' n\},
\]
where $c$ and $c'$ are defined as above. Note that $\cE$ is $\cF$-measurable.
Since every isolated vertex of $\Hrnp$ is in $\cI'$, we have
\begin{equation}\label{eprob}
 \Pr(\cE^\cc) \le \Pr(\cE_1^\cc)+\Pr(\cE_3^\cc) = o(1/\sigma_0).
\end{equation}

Let $Y_n=|F'|$; this will be our smoothing random variable.
Let $\cC'$ be the component of $H\supset H_1$ containing $\cC$, and $\cC''$
the component of $\Hrnp$ containing $\cC'$ (and hence $\cC$).
Let
\[
 X_n=n(\cC') \hbox{\quad and\quad} Z_n=|\cC'|-(r-2)n(\cC') = |\cC'|-(r-2)X_n.
\]
Each edge in $F'$ meets $\cC'$ in two vertices, and has no vertices outside
$\cC'$ in common with any other edge of $F'$. It follows that
\[
 n(\cC'') = X_n + Y_n\hbox{\quad and\quad} |\cC''| = |\cC'| +(r-2)Y_n,
\]
so
\[
 |\cC''|-(r-2)n(\cC'') = |\cC'| +(r-2)Y_n - (r-2)(X_n+Y_n) = |\cC'|-(r-2)X_n =Z_n.
\]
When $\cE_2$ holds, then $\cC''=\cL_1$.
Hence, whenever $\cE_2$ holds, we have
\begin{equation}\label{shift}
 N_1 = X_n +Y_n \hbox{\quad and\quad} L_1-(r-2)N_1 = Z_n.
\end{equation}

There are
\[
 n_a=\frac{1}{a!} \binom{|\cI'|}{r-2}\binom{|\cI'|-(r-2)}{r-2}\cdots \binom{|\cI'|-(a-1)(r-2)}{r-2} \binom{|\cC|}{2}^a
\]
possible sets $F'$ with $a$ edges.
Let $\pi=p_2/(1-p_2)$.
Since the probability of a hypergraph in the model $\Hrnptwo$ is proportional to $\pi$
raised to the power of the number of edges,
we see that the probability that $Y_n=a$ conditional on $\cF$ is equal to
\[
 p_a = \Pr(Y_n=a\mid\cF) =  \pi^a n_a\ \Big/\ \sum_{b=0}^{|\cI'|/(r-2)} \pi^b n_b.
\]
Hence, for $a+1\le |\cI'|/(r-2)$,
\begin{equation}\label{qa}
 q_a=\frac{p_{a+1}}{p_a} = \frac{1}{a+1} \frac{\pi}{(r-2)!} \binom{|\cC|}{2} (|\cI'|-a(r-2))_{r-2},
\end{equation}
where $(x)_y$ denotes the falling factorial $x(x-1)\cdots (x-y+1)$. Note that the sequence $(q_a)$ is strictly
decreasing, so $(p_a)$ is unimodal.

When $\cE$ holds, $|\cC|=\Theta(\eps n)$ and $|\cI'|=\Theta(n)$. Hence, for $|\cI'|-a(r-2)=\Omega(n)$,
recalling \eqref{p2sim} we have
\[
 q_a=\Theta\bb{ (a+1)^{-1} (\eps n^{-r+1}) (\eps n)^2 n^{r-2} } = \Theta(\eps^3 n/(a+1)).
\]
For $|\cI'|-a(r-2)=o(n)$ it is easy to see that $q_a=o(1)$.
Let $a_0$ be the minimal integer such that $q_{a_0}\le 1$.
Then we see that $a_0=\Theta(\eps^3 n)$, and certainly that $|\cI'|-a_0=\Omega(n)$.

Recalling that we write $\sigma_0$ for $\sqrt{\eps^3n}$,
it follows from \eqref{qa} that for $a=a_0+O(\sigma_0)$ we have
\[
 q_a = q_{a_0}(1+O(\sigma_0/a_0)) = q_{a_0}(1+O(\sigma_0^{-1})) =1+O(\sigma_0^{-1}).
\]
Since $q_a=p_{a+1}/p_a$, this has the following
consequence: if $a_1<a_2$ satisfy $a_i=a_0+O(\sigma_0)$ and
$a_1-a_2=o(\sigma_0)$, then
\begin{equation}\label{pasim}
 p_{a_2}/p_{a_1} = \prod_{a_1\le a<a_2} q_a = (1+O(\sigma_0^{-1}))^{o(\sigma_0)} = 1+o(1).
\end{equation}
From the unimodality of $(q_a)$ and the definition of $a_0$ we have $\max_a p_a = p_{a_0}$.
It is easy to see that $p_{a_0}=O(1/\sigma_0)$: otherwise, we could use \eqref{pasim}
to deduce that $\sum_a p_a>1$, a contradiction.
Hence, $p_a=O(1/\sigma_0)$ for every $a$. Thus, from \eqref{pasim}, for $a_i=a_0+O(\sigma_0)$ we have
\begin{equation}\label{padiff}
 a_1-a_2=o(\sigma_0) \implies p_{a_2} - p_{a_1} = o(1/\sigma_0).
\end{equation}
For $a>a_0$, by unimodality we have
\[
 1=\sum_b p_b \ge \sum_{a_0<b\le a} p_b \ge (a-a_0) p_a,
\]
so if $(a-a_0)/\sigma_0\to\infty$ then $p_a=o(1/\sigma_0)$. Similarly,
if $(a_0-a)/\sigma_0\to\infty$ then $p_a=o(1/\sigma_0)$. It follows that \eqref{padiff}
holds for any $a_1$, $a_2$ with $a_1-a_2=o(1/\sigma_0)$.

Let $t_n,t_n'\ge 0$ with $t_n-t_n'=o(\sigma_0)$, and let $I_n$ be any subset of the integers.
Since $X_n$ and $Z_n$ are $\cF$-measurable, whenever $\cE$ holds, then
the bound \eqref{padiff} on the difference between the conditional probabilities that $Y_n$
takes values within $o(\sigma_0)$ gives
\[
 \Pr\bb{ X_n+Y_n=t_n,\,Z_n\in I_n\mid \cF} - \Pr\bb{X_n+Y_n=t_n',\,Z_n\in I_n\mid \cF} = o(1/\sigma_0).
\]
Since $\cE$ is $\cF$-measurable and, from \eqref{eprob}, $\Pr(\cE^\cc)=o(1/\sigma_0)$, it follows that
\[
 \Pr(X_n+Y_n=t_n,\,Z_n\in I_n) - \Pr(X_n+Y_n=t_n',\,Z_n\in I_n) = o(1/\sigma_0).
\]
Recalling that $\Pr(\cE_2)=1-o(1/\sigma_0)$, from \eqref{shift} it follows that
\[
 \Pr\bb{ N_1=t_n,\, L_1-(r-2)N_1\in I_n }  -
 \Pr\bb{ N_1=t_n',\, L_1-(r-2)N_1\in I_n } = o(1/\sigma_0),
\]
completing the proof of Theorem~\ref{thexcess}.
\end{proof}

\section{Trees and forests}\label{sec_tc}

For $m\ge 2$, an \emph{$m$-cycle} in a hypergraph $H$ consists of distinct
vertices $v_1,\ldots,v_m$ and distinct edges $e_1,\ldots,e_m$
such that each $e_i$ contains both $v_i$ and $v_{i+1}$, with $v_{m+1}$
defined to be $v_1$.
Thus a $2$-cycle consists of two edges sharing at least two vertices.
Note that an $m$-cycle corresponds to a cycle of length $2m$
in the bipartite vertex-edge incidence graph $\GI(H)$ associated to $H$.

A hypergraph $H$ is a \emph{tree} if it is connected and contains no cycles,
or, equivalently, if $H$ can be built up by starting with a single
vertex, and adding new edges one-by-one so that each meets
the current hypergraph in exactly one vertex. Note that $H$ is a tree
if and only if $\GI(H)$ is a tree.

By an \emph{$r$-tree} we simply mean an $r$-uniform hypergraph
that is a tree. An \emph{$r$-forest} is a vertex-disjoint union of $r$-trees.
For $A\subset V$, an \emph{$A$-rooted $r$-forest on $V$} is an $r$-forest
with vertex set $V$ such that each component contains exactly one
vertex from $A$; in particular, there are $|A|$ components.
Note that $A$-rooted $r$-forests on $V$ exist if and only
if $|V|=|A|+(r-1)k$ for some integer $k\ge 0$ (the number of edges).
For $r=2$, the formula $a n^{n-a-1}$ for the number of $[a]$-rooted 2-forests
on $[n]$ was observed by Cayley~\cite{Cayley} and proved by R\'enyi~\cite{Renyi}.
We shall make repeated use of the following generalization
to hypergraphs, due to Selivanov~\cite{Selivanov}.

\begin{lemma}\label{l_rtree}
Let $r\ge 2$, $a\ge 1$ and $k\ge 0$ be integers, and set $n=a+(r-1)k$.
The number $F_{a,k}=F_{a,k}^{(r)}$ of $[a]$-rooted $r$-forests on $[n]=\{1,2,\ldots,n\}$ satisfies
\begin{equation}\label{Fan}
 F_{a,k} = a n^{k-1} \partit{k}{r-1},
\end{equation}
where
\[
 \partit{k}{t} = \frac{(kt)!}{k! t!^k}
\]
is the number of partitions of a set of size $kt$ into $k$ parts of size $t$.
\end{lemma}
We give a proof for completeness, since the original source is perhaps
a little obscure. (We only became aware of it from Karo\'nski and \L uczak~\cite{KL_sparse}).
\begin{proof}
In the trivial case $k=0$ we have $n=a$ so \eqref{Fan} evaluates to $1$, as required; from
now on suppose $k\ge 1$.

Any $[a]$-rooted $r$-forest $H$ on $[n]$ may be constructed by starting from the
hypergraph with vertex set $[a]$ and no edges, and adding edges one-by-one so
that each edge consists of one old vertex (a vertex already present) and a
\emph{group} of $r-1$ new vertices. Although there are in general many possible
orders in which the edges may be added to form a given $H$, the groups will
always be the same -- in each edge the old vertex is the unique vertex at minimal
graph distance from $\{1,2,\ldots,a\}$ in $H$. Let $\pi(H)$ denote the partition
of $[n]\setminus[a]$ formed by the groups. From now on we fix one of the $\partit{k}{r-1}$
possible partitions $\pi$ that may arise in this way, and consider the set
$\cH_\pi$ of $[a]$-rooted $r$-forests on $[n]$ with $\pi(H)=\pi$. Our aim is to
show that $|\cH_\pi|=a n^{k-1}$.

Fix an arbitrary order $\prec$ on the $(r-1)$-element subsets of $[n]\setminus [a]$.
By a \emph{leaf part} of $H$ we mean a part of $\pi(H)$ all of whose
vertices have degree $1$ in $H$.
Let $c(H)$ be the sequence defined as follows: pick the leaf part of $H$
earliest in the order $\prec$, write down the old vertex $v$ appearing
in the corresponding edge $e$, delete $e$, and continue until no edges
remain. The last edge deleted clearly has its old vertex in $[a]$,
so $c(H)$ consists of $k-1$ elements of $[n]$ followed by an element of $[a]$.
It is simple to check that this Pr\"ufer-type code gives a bijection between $\cH_\pi$
and $[n]^{k-1}\times [a]$, and the result follows.
\end{proof}

An alternative way of proving Lemma~\ref{l_rtree} is to map each $H\in \cH_\pi$ to a
$2$-forest on $a+k$ vertices ($[a]$ and the parts of $\pi$). This map
is many-to-one, but the multiplicity depends only on the number
of edges incident with $[a]$, and (surprisingly) one can apply R\'enyi's formula
for $r=2$ to deduce Lemma~\ref{l_rtree}.

One consequence of Lemma~\ref{l_rtree} is the following surprisingly simple
bound on the expected number of vertices at a given distance from the root set in a random
$[a]$-rooted $r$-forest. Recall that $(x)_y$ denotes the falling factorial $x(x-1)\cdots (x-y+1)$.

\begin{lemma}\label{l_dt}
Let $r\ge 2$, $a\ge 1$ and $k,\ell\ge 0$ be integers, and set $n=a+(r-1)k$.
In a random $[a]$-rooted $r$-forest on $[n]$, the expected number of vertices
at graph distance exactly $\ell$ from $[a]$ is equal to
\[
 (a+(r-1)\ell) \frac{(r-1)^\ell (k)_\ell}{n^\ell}
\]
and is (hence) at most $a+(r-1)\ell$.
\end{lemma}
Note that $k$ does not appear in the final upper bound.
\begin{proof}
Let $N$ be the number of ordered pairs $(F,v)$ where $F$ is an $[a]$-rooted $r$-forest
on $[n]$ and $v\in [n]$ is at graph distance $\ell$ from $[a]$ in $F$.
Since there is a unique path from $v$ to $[a]$ in $F$, we can instead view
$N$ as the number of tuples $(F,v_0,e_1,\ldots,v_{\ell-1},e_\ell,v_\ell)$
where $F$ is an $[a]$-rooted $r$-forest on $[n]$,
$v_0\in [a]$, and $v_0e_1\cdots e_\ell v_\ell$ is a path in $F$.
(The bijection from such tuples to pairs $(F,v)$ maps $v_\ell$ to $v$.)

With $F$ not yet determined, there are $a$ choices for $v_0$,
then $\binom{(r-1)k}{r-1}$ choices for the remaining vertices that
with $v_0$ make up $e_1$. Then there are $r-1$ choices for $v_1$,
then $\binom{(r-1)(k-1)}{r-1}$ choices for the rest of $e_2$, and so on,
giving
\begin{eqnarray*}
 N_1&=& a (r-1)^\ell \binom{(r-1)k}{r-1}\cdots\binom{(r-1)(k-\ell+1)}{r-1} \\
 &=& a(r-1)^\ell \frac{((r-1)k)!}{((r-1)(k-\ell))! (r-1)!^\ell}
\end{eqnarray*}
choices for $(v_0,e_1,\ldots,e_\ell,v_\ell)$. Now we must choose an $[a]$-rooted
$r$-forest $F$ on $[n]$ containing the edges $e_1,\ldots,e_\ell$; this is the same as choosing
an $[S]$-rooted $r$-forest $F'$ on $[n]$ where $S=[a]\cup e_1\cup\cdots\cup e_\ell$
is a set of $a+(r-1)\ell$ vertices. By Lemma~\ref{l_rtree}
we thus have
\begin{eqnarray*}
 N &=& (a+(r-1)\ell) n^{k-\ell-1} \frac{((r-1)(k-\ell))!}{(k-\ell)!(r-1)!^{k-\ell}} N_1 \\
 &=& (a+(r-1)\ell) n^{k-\ell-1} a (r-1)^\ell \frac{((r-1)k)!}{(k-\ell)! (r-1)!^k}.
\end{eqnarray*}
The expectation we wish to calculate
is precisely $N$ divided by the number of $[a]$-rooted $r$-forests on $[n]$.
By Lemma~\ref{l_rtree} the expectation is thus
\begin{eqnarray*}
 (a+(r-1)\ell) n^{-\ell} (r-1)^\ell \frac{k!}{(k-\ell)!}
  &=& (a+(r-1)\ell) \frac{(r-1)^\ell (k)_\ell}{n^\ell} \\
  &\le& (a+(r-1)\ell) ((r-1)k/n)^\ell \\
  &\le& a+(r-1)\ell,
\end{eqnarray*}
as required.
\end{proof}

\section{The smoothing distribution}\label{sec_dist}

Given positive integers $m$ and $a$, let $A_1\subset A\subset V$
with $|A_1|=a$, $|A|=2a$ and $|V|=2a+(r-1)m$,
and let $F$ be an $A$-rooted $r$-forest on $V$ chosen uniformly at random.
Let $Y_{m,a}$ be the total number
of edges of $F$ in components rooted in $A_1$. Note that $F$ has $m$ edges, so $0\le Y_{m,a}\le m$.

\begin{lemma}\label{ldist}
Let $m=m(n)$ and $a=a(n)$ satisfy $m=o(a^2)$ and $m=\Omega(a)$, let $Y_n=Y_{m,a}$,
and set $\sigma_n=m^{3/2}a^{-1}$.
Then for any integers $x_n$, $y_n$ with $x_n-y_n=o(\sigma_n)$ we have
\[
 \Pr(Y_n=x_n)-\Pr(Y_n=y_n)=o(1/\sigma_n),
\]
and $\Pr(Y_n=x_n)=O(1/\sigma_n)$.
\end{lemma}
In the terminology of Section~\ref{sec_example}, $Y_{m,a}$ is $\sigma_n$-smooth.
\begin{proof}
As usual, we suppress the dependence on $n$ in the notation, for example writing $\sigma$ for $\sigma_n$.

Note first that our assumptions imply that $a=O(m)=o(a^2)$, so certainly $a\to\infty$ and thus $m\to\infty$.
Note for later that $\sigma/m=m^{1/2}a^{-1}=\sqrt{m/a^2}$, so
\[
 \sigma=o(m).
\]

Let $p_k=\Pr(Y_n=k)$.
Considering first the choices for the vertices outside $A$ appearing in the subforest rooted at $A_1$, we
see that
\[
 p_k = \binom{(r-1)m}{(r-1)k}  \frac{F_{a,k}F_{a,m-k}}{F_{2a,m}},
\]
where $F_{a,k}$ denotes the number of $X$-rooted $r$-forests on $Y$ when $X\subset Y$ with $|X|=a$ and
$|Y|=a+(r-1)k$.
From now on, let us write $t$ for $r-1$, since this will appear so often in the following calculations.
By Lemma~\ref{l_rtree}, writing $\ell$ for $m-k$, for $0\le k \le m$ we have
\begin{eqnarray}
 p_k
 &=& \binom{tm}{tk} \frac{a (a+tk)^{k-1} (tk)!k!^{-1}t!^{-k} a (a+t\ell)^{\ell-1} (t\ell)!\ell!^{-1}t!^{-\ell}}
{2a(2a+tm)^{m-1} (tm)!m!^{-1}t!^{-m}} \nonumber \\
 &=& \frac{a}{2}\binom{m}{k}\frac{ (a+tk)^{k-1} (a+t\ell)^{\ell-1} }{(2a+tm)^{m-1}}. \label{pk}
\end{eqnarray}
We shall prove the following three statements concerning functions $k$, $k_1$ and $k_2$ of $n$
bounded between $0$ and $m(n)$, where $\sigma=\sigma(n)=m^{3/2}a^{-1}$:
\begin{equation}\label{aim2}
 \hbox{If $k_1=k_2+o(\sigma)$ and $k_1,k_2=m/2+O(\sigma)$ then $p_{k_1}\sim p_{k_2}$.}
\end{equation}
\begin{equation}\label{aim1}
 \hbox{If $k=m/2+O(\sigma)$ then $p_k=O(1/\sigma)$.}
\end{equation}
\begin{equation}\label{aim3}
\hbox{If $|k-m/2|/\sigma\to\infty$ then $p_k=o(1/\sigma)$.}
\end{equation}
Suppose for the moment that these three statements hold, and consider sequences $k_1=k_1(n)$ and $k_2=k_2(n)$
with $k_1-k_2=o(\sigma)$. The lemma asserts that then
\begin{equation}\label{finalaim}
 p_{k_1}-p_{k_2}=o(1/\sigma) \hbox{\quad and\quad} p_{k_1}=O(1/\sigma).
\end{equation}
In the special case where $k_1=m/2+O(\sigma)$, the relations \eqref{aim2} and \eqref{aim1} give \eqref{finalaim}.
In the special case where $|k_1-m/2|/\sigma\to\infty$, then also $|k_2-m/2|/\sigma\to\infty$,
so by \eqref{aim3} both $p_{k_1}$ and $p_{k_2}$ are $o(1/\sigma)$, and \eqref{finalaim} follows.
The general case now follows by a standard subsequence argument: a counterexample would have a subsequence
falling into one of these two special cases.

Our aim is now to prove \eqref{aim2}--\eqref{aim3}.
Let us first deal with the extreme values, i.e., cases where $k$ is very close to $0$
or to $m$.
We shall show that when $k\le c_0a$ for some constant $c_0$,
then $p_{k+1}\ge p_k$, so if we can show that $p_k=o(1/\sigma)$ for $k=\ceil{c_0a}$, then
the same bound for $k<\ceil{c_0a}$ follows.

From \eqref{pk} we see that for $0\le k<m$ we have
\begin{eqnarray*}
 \frac{p_{k+1}}{p_k}
&=& \frac{\ell}{k+1} \ \frac{(a+t(k+1))^k}{(a+tk)^{k-1}} \ \frac{(a+t(\ell-1))^{\ell-2}}{(a+t\ell)^{\ell-1}} \\
&=& \frac{\ell}{k+1} \ \frac{a+tk}{a+t(\ell-1)}
    \left(1+\frac{t}{a+tk}\right)^k\left(1+\frac{t}{a+t(\ell-1)}\right)^{-(\ell-1)} \\
 &=& \frac{a+tk}{k+1}\ \frac{\ell}{a+t(\ell-1)}\ \Theta(1),
\end{eqnarray*}
since $(1+x)^n=\exp(O(nx))=\Theta(1)$ when $x\ge 0$ and $nx=O(1)$.
For $k\le m/2$, say, we have $a+t(\ell-1)=\Theta(a+m)=\Theta(m)$ and $\ell=\Theta(m)$, so
$p_{k+1}/p_k=\Theta((a+tk)/(k+1))$. It follows that there exists a constant $c_0$ such
that for $k\le c_0 a$ we have $p_{k+1}/p_k\ge 1$, so
\begin{equation}\label{ksmall}
 \max_{k\le c_0a} p_k \le p_{\ceil{c_0a}}.
\end{equation}

Since $m=\Omega(a)$, we may choose $c_0$ small enough that $\ceil{c_0a}\le m/4$, say.
In proving \eqref{aim3}, we may assume by symmetry that $k\le m/2$.
Since $\sigma=o(m)$, we have $|\ceil{c_0a}-m/2|/\sigma\ge m/(4\sigma)\to\infty$, so
in the light of \eqref{ksmall}, to prove
\eqref{aim3} it suffices to show that
\begin{equation}\label{aim3p}
 \hbox{If $(m/2-k)/\sigma\to\infty$ and $k\ge c_0 a$ then $p_k=o(1/\sigma)$.}
\end{equation}

From this point our aim is to prove \eqref{aim2}, \eqref{aim1} and \eqref{aim3p}.
Since all three statements only involve $k$ such that $k,\ell=\Omega(a)$,
from now on we impose this condition. In this case, from \eqref{pk} and Stirling's formula we have
\[
 p_k\sim \frac{a}{2\sqrt{2\pi}}\ \frac{m^m}{k^k\ell^\ell} \ \sqrt{\frac{m}{k\ell}}
 \ \frac{tm+2a}{(tk+a)(t\ell+a)}\ \frac{(tk+a)^k(t\ell+a)^\ell}{(tm+2a)^m}.
\]
Roughly speaking, we shall write this expression as a polynomial factor times
an exponential factor. Then we expand the function inside the exponential around $k=m/2$
to see that $p_k$ is small when $k$ is far from $m/2$, and does not change too rapidly
when $k$ is close to $m/2$. The complication is that the polynomial factor `blows up'
as $k/m$ approaches $0$ or $1$, and it is only the condition $m=o(a^2)$ that ensures
that this `blow up' is beaten by the exponential factor.

Setting
\[
  x=k/m \hbox{\quad and\quad} \beta=a/(tm),
\]
and noting that by assumption $\beta=O(1)$, we have
\begin{eqnarray}
 p_k &\sim& \frac{a}{2\sqrt{2\pi}}\ \sqrt{\frac{1}{x(1-x)m}}\ \frac{1}{tm} \ \frac{1+2\beta}{(x+\beta)(1-x+\beta)}
 \nonumber \\
&&\hskip 3cm \left( x^{-x}(1-x)^{-(1-x)} \frac{(x+\beta)^x(1-x+\beta)^{1-x}}{1+2\beta}\right)^m\nonumber \\
 &=& \frac{a(1+2\beta)}{2\sqrt{2\pi} t m^{3/2}} f(x) \exp(-m g(x))\nonumber \\
 &=& \frac{c}{\sigma} f(x)\exp(-m g(x)),\label{cfg}
\end{eqnarray}
where $c=(1+2\beta)/(2t\sqrt{2\pi})=\Theta(1)$ is independent of $k$,
\begin{equation}\label{fdef}
 f(x) = x^{-1/2}(1-x)^{-1/2}(x+\beta)^{-1}(1-x+\beta)^{-1},
\end{equation}
and
\[
  g(x) = x\log x+(1-x)\log(1-x) -x\log(x+\beta)-(1-x)\log(1-x+\beta) +\log(1+2\beta).
\]

It is easy to see that $g(1/2)=0$. Moreover,
\[
 g'(x) = \log x-\log(1-x)-\log(x+\beta)+\log(1-x+\beta)+\frac{\beta}{x+\beta}-\frac{\beta}{1-x-\beta}
\]
is also zero at $x=1/2$, and (after a little calculation) we see that
\begin{equation}\label{g''}
 g''(x) = \beta^2 \left(\frac{1}{x(x+\beta)^2}+\frac{1}{(1-x)(1-x+\beta)^2}\right) >0.
\end{equation}
Since $\beta=O(1)$, for $1/8\le x\le 7/8$, say,
the bracket in \eqref{g''} is uniformly $\Theta(1)$,
so we have $g''(x)=\Theta(\beta^2)$. Integrating twice, we see
that for $x$ in this range,
\begin{equation}\label{g'g}
 g'(x) = \Theta( \beta^2|x-1/2|) \hbox{\quad and\quad} g(x) = \Theta(\beta^2(x-1/2)^2).
\end{equation}

Recalling that $\beta=a/(tm)$ and $\sigma=m^{3/2}/a$, note that
\begin{equation}\label{bsm}
 \beta^2\sigma^2/m^2 = \frac{a^2}{t^2m^2} \frac{m^3}{a^2}\frac{1}{m^2} = \frac{1}{t^2m} =\Theta(m^{-1}).
\end{equation}
Let $k_1$ and $k_2$ satisfy $k_i=m/2+O(\sigma)$ and $k_1-k_2=o(\sigma)$, and set $x_i=k_i/m$.
Then $x_i=1/2+O(\sigma/m)$, and $x_1-x_2=o(\sigma/m)$. By the Mean Value Theorem,
there is some $\xi=1/2+O(\sigma/m)$ for which
\[
 |g(x_1)-g(x_2)| = |g'(\xi)||x_1-x_2| = O(\beta^2 |\xi-1/2| |x_1-x_2|) = o(\beta^2\sigma^2/m^2) = o(1/m),
\]
from \eqref{g'g} and \eqref{bsm}.
From \eqref{fdef}, since $x_1,x_2\sim 1/2$
we have $f(x_1)\sim f(1/2)\sim f(x_2)$, and it follows from \eqref{cfg}
that $p_{k_1}\sim p_{k_2}$, proving \eqref{aim2}.
For \eqref{aim1}, simply note that $g(x)\ge 0$ always, while if $k=m/2+O(\sigma)$ then
$x=k/m$ satisfies $x=1/2+O(\sigma/m)=1/2+o(1)$, so $x$ is bounded away from $0$ and $1$
and \eqref{fdef} gives $f(x)=O(1)$. Hence \eqref{cfg} gives $p_k=O(1/\sigma)$, proving
\eqref{aim1}.

Finally, we turn to the proof of \eqref{aim3p}, considering $k$ `far' from $m/2$,
but not too close to $0$ or to $m$. First, note that since $\beta=O(a/m)$ and, by assumption,
$m=o(a^2)$, we have
\[
 \beta^2m\to\infty.
\]
Let $c_0 a\le k\le m/2$ with $(m/2-k)/\sigma\to\infty$ and set $x=k/m$,
so $x<1/2$ and $(1/2-x)/(\sigma/m)\to\infty$. If $x\ge 1/8$ then $f(x)=\Theta(1)$ while from \eqref{g'g}
we have $g(x)=\Omega(\beta^2)$ and hence $m g(x)\to\infty$.
Thus \eqref{cfg} gives $p_k=o(1/\sigma)$, as required.

Suppose instead that $x<1/8$; note that $x=k/m\ge c_0a/m=c_1\beta$, where $c_1=c_0t$ is a positive constant.
For $y\ge c_1\beta$ we have $\beta=O(y)$ and hence $y^{-1}(y+\beta)^{-2}=\Omega(y^{-3})$,
so in this range \eqref{g''} gives $g''(y)\ge c\beta^2 y^{-3}$ for some constant $c>0$. It follows easily that
there is a constant $c'$ such that for $c_1\beta\le x\le 1/8$ we have $g(x)\ge c'\beta^2 x^{-1}$.
[Indeed, for $c_1\beta\le y\le 1/4$ we have
$-g'(y)=\int_{z=y}^{1/2}g''(z) \ge \int_{z=y}^{2y}g''(z) =\Omega(\beta^2 y^{-2})$,
and then $g(x)=\int_{y=x}^{1/2}(-g'(y))\ge \int_{y=x}^{2x} (-g'(y)) = \Omega(\beta^2 x^{-1})$.]
Hence, for $c_1\beta\le x\le 1/8$ we have
\[
 f(x)\exp(-m g(x)) = O(x^{-3/2})\exp(-m g(x)) = O(x^{-3/2} \exp(-c'\beta^2 m x^{-1})).
\]
Since $\beta^2m\to\infty$, it follows that $f(x)\exp(-m g(x))\to 0$ uniformly in this range, which
with \eqref{cfg} gives $p_k=o(1/\sigma)$, completing the proof of \eqref{aim3p} and hence of
the lemma.
\end{proof}

With a small amount of further work, the argument above extends to show that (under the given
assumptions) $Y_{m,a}$ satisfies a Gaussian local limit theorem. We shall not need this,
so we omit the details.

\section{Discrete duality}\label{sec_dual}

Recall that $\Hrnp$ denotes the random $r$-uniform hypergraph on $[n]$ in which each
of the $\binom{n}{r}$ possible edges is present independently with probability $p$.
As in the introduction, we write
$p=p(n)$ as $\lambda(n)(r-2)!n^{-r+1}$,
so $\la=1$ corresponds to the critical point of the phase transition.
More generally, for any $r$, $n$ and $p$ we call
\begin{equation}\label{bfdef}
 \lambda= pn^{r-1}/(r-2)!
\end{equation}
the \emph{branching factor} of $\Hrnp$.

Given any $\la>1$, define $\las<1$, the parameter \emph{dual} to $\la$, by
\[
 \las e^{-\las} = \la e^{-\la}.
\]
It is easy to check that $\las=\la(1-\rho_\la)$, where $\rho_\la=\rho_{2,\la}$
is defined in \eqref{rldef}, and that for $\la>1$ with $\la=O(1)$ we have
\begin{equation}\label{lasrate}
 \las=1-\Theta(\la -1).
\end{equation}

In the regime we are interested in, we have $\lambda=1+\eps$ with $\eps=\eps(n)$
bounded and $\eps^3n\to\infty$, so by the results of~\cite{KL_giant,BR_hyp},
$\Hrnp$ is supercritical.
Defining $\delta=\delta(n)\ge (\eps^3n)^{-1/3}$ and $\range= [(1-\delta)\rho_{r,\la}n, (1+\delta)\rho_{r,\la}n]$
as in \eqref{rangedef}, by \eqref{rangewvhp} we have
\begin{equation}\label{rangewhp}
 \Pr(L_1\in\range) = 1-O(1/(\eps^3n)) = 1-o(1).
\end{equation}
We shall only consider possible values of $L_1$ lying in $\range$. We start
with a simple calculation, showing that if $s\in\range$ then $\Hrnsp$ is subcritical.

\begin{lemma}\label{dual1}
Under our Weak Assumption~\ref{A1}, for any $s=s(n)\in\range$,
the random hypergraph $\Hrnsp$ has branching factor $1-\Theta(\eps)$.
\end{lemma}
\begin{proof}
Let $\mu_n=\rho_{r,\la}n$. Ignoring the fact that $\mu_n$ need not be an integer,
if we define the branching factor $\la(\Hrnsop)$ by \eqref{bfdef}, with
$n-\mu_n$ in place of $n$,
then
\[
 \la(\Hrnsop) = (1-\mu_n/n)^{r-1}\la = (1-\rho_{r,\la})^{r-1}\la = (1-\rho_\la)\la = \las,
\]
which is $1-\Theta(\eps)$ by \eqref{lasrate}.
For $s\in\range$ we have $(n-s)/(n-\mu_0)=1+O(\delta\eps)=1+o(\eps)$, so, since $r$ is constant,
$\la(\Hrnsp)=(1+o(\eps))^{r-1}\la(\Hrnsop)=1-\Theta(\eps)$ also.
\end{proof}
Note that here we do not really need $\delta$ to tend to zero:
it would suffice to assume that $\delta$
is at most some small constant depending on the upper bound on $\eps$.

A simple consequence of the fact that $\Hrnsp$ is subcritical is that
it is unlikely to contain a component with $s$ or more vertices. We state
a convenient form of this result rather than the strongest version possible.

\begin{lemma}\label{lccrit}
Under our Weak Assumption~\ref{A1}, for any $s=s(n)\in\range$, whp $L_1(\Hrnsp)<n^{2/3}<s$.
\end{lemma}
\begin{proof}
From either Karo\'nski and \L uczak~\cite[Theorem 6]{KL_giant}
or~\cite[Theorem 2]{BR_hyp2} (which gives a better probability bound but a worse constant
$c_r$), there is a constant $c_r>0$ such that if $\Hrmp$ has branching
factor $1-\eta$ where $\eta^3m\to\infty$, then whp
\[
 L_1(\Hrmp)\le c_r\eta^{-2}\log(\eta^3m) = o(m^{2/3}).
\]
For $s\in\range$, by Lemma~\ref{dual1} the branching factor of $\Hrnsp$ is $1-\eta$
with $\eta=\Theta(\eps)$. Since $m=n-s=\Theta(n)$ and $\eps^3n\to\infty$, we have $\eta^3m\to\infty$,
so whp $L_1(\Hrmp)<m^{2/3}<n^{2/3}$.
The result follows since $s=\Theta(\eps n)$, so $s/n^{2/3}\to\infty$ and in particular $s>n^{2/3}$
if $n$ is large enough.
\end{proof}

Let $\cL_1$ be the component of $\Hrnp$ with the most vertices, if there is a unique
such component. In the case of ties we order (the vertex sets of) possible components
arbitrarily (e.g., by the lowest numbered vertex present), and use this order
to break the tie. Of course $|\cL_1|=L_1$.
The following explicit version of the discrete duality principle
says that we may treat the graph outside $\cL_1$ as a subcritical instance of
the same hypergraph model. We write $\cH_s$ for the set of all labelled
($r$-uniform) hypergraphs with exactly $s$ vertices. We always assume
implicitly that any conditional probability is defined: i.e., if the event
being conditioned on has probability $0$, there is nothing to prove.

\begin{lemma}\label{dual2}
Suppose that our Weak Assumption~\ref{A1} holds,
and define $\range=\range_n$ as in \eqref{rangedef}.
Let $\cQ$ be any isomorphism invariant property of hypergraphs,
and $f$ any isomorphism invariant function from hypergraphs to the non-negative reals.
Then, for any $s\in\range$ and any $\cP \subset \cH_s$, we have
\[
 \Pr\bb{\Hrnp \setminus \cL_1 \text{ has }\cQ \mid \cL_1\in\cP} \le (1+o(1)) \Pr( \Hrnsp \text{ has }\cQ),
\]
and
\[
 \E\bb{f(\Hrnp \setminus \cL_1) \mid \cL_1\in\cP} \le (1+o(1)) \E( f(\Hrnsp) ),
\]
with the error terms uniform over all $s\in \range$ and $\cP\subset\cH_s$.
\end{lemma}
The most natural case here is to take $\cP=\cH_s$, in which case we are simply conditioning
on the event $L_1=s$. Often we shall take $\cP$ to be the set of hypergraphs with $s$
vertices and nullity $t$; then we are conditioning on the event $\{L_1=s, N_1=t\}$.

\begin{proof}
Without loss of generality $\cP$ consists of a single hypergraph $H_s$
with vertex set $S\subset [n]$ with $|S|=s$.
From the definitions of $\Hrnp$ and of $\cL_1$, the conditional distribution
of $\Hrnp\setminus \cL_1$ given that $\cL_1=H_s$ is that
of the random hypergraph $H'=\Hrnsp$
on the vertex set $[n]\setminus S$ conditioned on the event $\cE$ that

\smallskip
(i) $H'$ contains no component with more than $s$ vertices, and

(ii) $H'$ has no $s$-vertex component that beats $H_s$ in the
tie-break order used in defining $\cL_1$.

\smallskip\noindent
By Lemma~\ref{lccrit}, $\Pr(\cE)=1-o(1)$. Hence,
\begin{multline*}
  \Pr\bb{\Hrnp \setminus \cL_1 \text{ has }\cQ \mid \cL_1=H_s }
  = \Pr\bb{H' \hbox{ has }\cQ \mid \cE} \\
\le \frac{ \Pr(H' \hbox{ has }\cQ)}{\Pr(\cE)}
 = (1+o(1)) \Pr(H' \hbox{ has }\cQ),
\end{multline*}
proving the first statement. For the second, argue similarly, or express
$\E(f(H))$ as $\int_{t\ge 0}\Pr(f(H)\ge t)\mathrm{d}t$
and apply the first statement.
\end{proof}

A variant of the argument above gives the following result, which
may be seen as an extension of an observation of Karo\'nski and {\L}uczak~\cite[p.\ 133]{KL_giant}.
By a \emph{property} of hypergraphs we simply mean a set of hypergraphs; we do not assume that this set is
closed under isomorphism. As usual, let $\cL_1$ be a component of $\Hrnp$ with the maximal
number of vertices, chosen according to any fixed rule in the case of ties.

\begin{lemma}\label{lbigep}
Let $\cQ_s$ be any property of $s$-vertex hypergraphs,
and let $N_s$ be the expected number of components of $\Hrnp$ having property $\cQ_s$.
Let $\cU$ be the event that $\Hrnp$ has at most one component with more than $n^{2/3}$ vertices,
and set $\cA_s=\{N_s>0\}\cap \cU$ and $\cB_s=\{N_s>0\}\cap \cU^\cc$.
Under our Weak Assumption~\ref{A1} we have
\begin{equation}\label{ep}
 \Pr(\cL_1\in\cQ_s)\sim \Pr(\cA_s) \sim \E[N_s]
\end{equation}
and
\begin{equation}\label{ep2}
 \Pr(\cB_s) = o(\Pr(\cL_1\in\cQ_s)),
\end{equation}
uniformly over all in $s\in \range$ and all properties $\cQ_s$, where $\range$ is defined in \eqref{rangedef}.
\end{lemma}
Note that $\cU$ holds whp by (for example) Theorem~\ref{thsupertail}.
\begin{proof}
Clearly
\begin{equation}\label{NS1}
 \E[N_s]\ge \Pr(N_s>0) \ge \Pr(\cL_1\in\cQ_s)  \ge \Pr(\cA_s).
\end{equation}
Let $N^+\ge N$ denote the number of components of $\Hrnp$ with more than $n^{2/3}$ vertices.
If $\cA_s$ holds, then $N_s=1$. If $\cA_s$ does not hold and
$N_s>0$, then $N^+\ge 2$. Hence
\[
 N_s\le \ind{\cA_s} + N_s \ind{N^+\ge 2}
\]
and, taking expectations,
\begin{equation}\label{NS2}
 \E[N_s] \le \Pr(\cA_s) + \E[N_s \ind{N^+\ge 2}].
\end{equation}
For $S\subset [n]$ with $|S|=s$, let $\cQ_S$ be the event that $S$ is the vertex
set of a component of $\Hrnp$ having property $\cQ_s$. Then
\begin{multline*}
 \E[N_s \ind{N^+\ge 2}] = \E \sum_{S\::\:|S|=s} \ind{\cQ_S} \ind{N^+\ge 2}
= \sum_S \Pr(\cQ_S \cap \{N^+\ge 2\})\\
 = \sum_S \Pr(\cQ_S) \Pr(N^+\ge 2\mid \cQ_S)
 = \sum_S \Pr(\cQ_S) \Pr(L_1(\Hrnsp)>n^{2/3})\\
 = \E[N_s] \Pr(L_1(\Hrnsp)>n^{2/3}) = o(\E[N_s]),
\end{multline*}
by Lemma~\ref{lccrit}.

From \eqref{NS2} we now obtain $\Pr(\cA_s)\ge (1-o(1))\E[N_s]$, which
combined with \eqref{NS1} completes the proof of \eqref{ep}.
The final statement \eqref{ep2} follows since $\Pr(\cB_s)=\Pr(N_s>0)-\Pr(\cA_s) \le \E[N_s]-\Pr(\cA_s)$.
\end{proof}

\section{Trees, paths and cycles outside the giant component}\label{sec_sub}

Throughout this section we assume our Weak Assumption~\ref{A1}.
In other words $r\ge 2$ is fixed, and
$p=p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)=O(1)$ and $\eps^3n\to\infty$;
we write $\la$ for $1+\eps$, which is the branching factor of $\Hrnp$ as defined in \eqref{bfdef}.

Our next lemma concerns trees outside the giant component.
As in Section~\ref{sec_dual} we consider the hypergraph $H'=\Hrmp$ where $m=n-s$ with $s\in\range$,
where $\range$ is defined as in \eqref{rangedef}.

\begin{lemma}\label{smalltree}
Let $T_k$
denote the number of tree components of $H'$ with $k$ edges,
and $T^{(2)}_{k,\ell}$ the number of ordered pairs $(T,T')$
of distinct tree components of $H'$ with $e(T)=k$ and $e(T')=\ell$.
Then
\begin{equation}\label{mk}
 \mu_k = \E[T_k] = \Theta(n(k+1)^{-5/2})
\end{equation}
and
\begin{equation}\label{mkl}
 \mu_{k,\ell} = \E[T^{(2)}_{k,\ell}] = \mu_k\mu_\ell\bb{1+O(\eps(k+\ell)^2m^{-1})} \sim\mu_k\mu_\ell,
\end{equation}
uniformly in $0\le k$, $\ell\le 10/\eps^2$ and $s\in\range$.
\end{lemma}
\begin{proof}
Considering first the number of choices for the $k(r-1)+1$ vertices,
then the number of trees $T$ on the given vertex set
(for which we apply Lemma~\ref{l_rtree} with $a=1$), and finally the probability
that the edges of $T$ are present but no other edges incident with $T$ are, we have
\[
 \mu_k = \binom{m}{k(r-1)+1} (k(r-1)+1)^{k-1} \partit{k}{r-1}
p^k (1-p)^{t_{m,k}-k},
\]
where
\[
 t_{m,k} = \binom{m}{r} - \binom{m-k(r-1)-1}{r}
\]
is the number of potential hyperedges on an $m$-vertex set meeting a given $(k(r-1)+1)$-vertex set at least once.
Postponing the evaluation of $\mu_k$ for the moment, if we write a similar formula for
$\mu_{k,\ell}$, then most terms agree with the corresponding terms in $\mu_k\mu_\ell$. Indeed,
writing $a$ for $k(r-1)+1$ and $b$ for $\ell(r-1)+1$, it is easy to see that
\begin{equation}\label{mklc}
 \frac{\mu_{k,\ell}}{\mu_k\mu_\ell} =
 \binom{m-a}{b} \binom{m}{b}^{-1} (1-p)^{-t_{m,k,\ell}},
\end{equation}
where $t_{m,k,\ell}$ is the number of potential hyperedges meeting both a given set of $a$
vertices and a given disjoint set of $b$ vertices.
Note that
\[
 t_{m,k,\ell}=ab\binom{m}{r-2}+O((a+b)^3m^{r-3}) = ab\frac{m^{r-2}}{(r-2)!} + O((a+b)^3m^{r-3}).
\]
Writing
\[
 \la' = p m^{r-1}/(r-2)!
\]
for the branching factor of $H'=\Hrmp$ (see \eqref{bfdef}), since $p=O(n^{-r+1})=O(m^{-r+1})$
it follows that
\[
 pt_{m,k,\ell} = \la' ab/m +O((a+b)^3m^{-2}).
\]
Since, crudely, $p=O(1/m)$ and $ab=O((a+b)^3)$,
from this it certainly follows that $p^2t_{m,k,\ell}=O((a+b)^3m^{-2})$, so
\begin{equation}\label{l1p}
 \log\left((1-p)^{-t_{m,k,\ell}}\right) = pt_{m,k,\ell}+O(p^2t_{m,k,\ell})
 = \la' ab/m +O((a+b)^3m^{-2}).
\end{equation}

Using the formula $\binom{m-a}{b}/\binom{m}{b}=\exp(-ab/m+O((a+b)^3/m^2))$,
valid for $a,b\le m/3$, say, and
recalling that $1-\la'=\Theta(\eps)$ by Lemma~\ref{dual1}, from \eqref{mklc} and \eqref{l1p}
we see that
\[
 \log\left(\frac{\mu_{k,\ell}}{\mu_k\mu_\ell}\right)
 = \frac{(\la'-1)ab}{m} + O((a+b)^3m^{-2}) = O(\eps(a+b)^2m^{-1}) =o(1),
\]
since $a+b=O(\eps^{-2})=o(\eps m)$. This proves \eqref{mkl}.

Returning to $\mu_k$, for $k=0$ we have $\mu_k=m(1-p)^{t_{m,0}}$.
Since $m=\Theta(n)$, $t_{m,0}=\binom{m-1}{r-1}=\Theta(n^{r-1})$ and $p=\Theta(n^{-r+1})$,
it follows that $\mu_0=\Theta(n)$, as required. From now on suppose that $1\le k\le 10/\eps^2$.
Writing $f\approx g$ for $f=\Theta(g)$,
since $p^2t_{m,k}=O(p^2km^{r-1})=O(pk)$ and $pk=o(1)$, we have
\begin{eqnarray*}
 \mu_k &\sim& m\binom{m-1}{k(r-1)}(k(r-1)+1)^{k-2} \frac{(k(r-1))!}{k!(r-1)!^k}p^k \exp(-pt_{m,k}) \\
 &\approx& m (m-1)_{k(r-1)} \frac{k^{k-2}(r-1)^{k-2}}{k!(r-1)!^k}p^k \exp(-pt_{m,k})\\
 &\approx& mk^{-2} (m-1)_{k(r-1)} \frac{k^k}{k!(r-2)!^k}p^k \exp(-pt_{m,k}),
\end{eqnarray*}
where $(x)_y$ denotes the falling factorial $x(x-1)\cdots(x-y+1)$.
For $y\le x/2$,
\[
 (x-1)_y=x^y\exp\left(-\frac{y^2}{2x}+O(y/x)+O(y^3/x^2)\right).
\]
Since $m=\Theta(n)$ and $\eps^3n\to\infty$,
both $k/m$ and $k^3/m^2$ are $o(1)$. Hence
\begin{eqnarray}
 \mu_k &\approx&  mk^{-2} \left(\frac{m^{r-1}p}{(r-2)!}\right)^k \frac{k^k}{k!}
 \exp\left(-pt_{m,k}-\frac{(r-1)^2k^2}{2m}\right) \nonumber \\
 &\approx& mk^{-5/2} (\la')^k  \exp\left(k-pt_{m,k}-\frac{(r-1)^2k^2}{2m}\right), \label{mklast}
\end{eqnarray}
since $k^k/k!=\Theta(e^k/\sqrt{k})$.

Now
\begin{eqnarray*}
 t_{m,k} &=& \frac{m^r-(m-k(r-1))^r}{r!} +O(m^{r-1}) \\
 &=& \frac{rk(r-1)m^{r-1}-\binom{r}{2}k^2(r-1)^2m^{r-2}}{r!} + O(m^{r-1}+k^3m^{r-3})\\
 &=& \frac{km^{r-1}}{(r-2)!} - \frac{k^2(r-1)^2m^{r-2}}{2(r-2)!} +O(m^{r-1}).
\end{eqnarray*}
Since $p=\la'(r-2)!/m^{r-1}$, it follows that
\[
 pt_{m,k} = \la' k -\la' \frac{(r-1)^2k^2}{2m}+O(1),
\]
so the term inside the exponential in \eqref{mklast} is
\[
 k(1-\la') -(1-\la')\frac{(r-1)^2k^2}{2m} +O(1) = k(1-\la')+O(1),
\]
recalling that $1-\la'=O(\eps)$, that $k=O(\eps^{-2})$, and that $\eps^3m\to\infty$.
Hence, from \eqref{mklast},
\[
 \mu_k \approx mk^{-5/2} (\la' e^{1-\la'})^k.
\]
Since $(1-x)e^x=\exp(O(x^2))$ when $x$ is bounded,
we see that $(\la' e^{1-\la'})^k = \exp(O(\eps^2k)) =\Theta(1)$,
completing the proof of \eqref{mk}.
\end{proof}

\begin{corollary}\label{csmallt}
Suppose that our Weak Assumption~\ref{A1} holds, and define $\range$ as in \eqref{rangedef}.
There is a constant $c>0$ such that, for any $s\in\range$ and $t\ge 0$,
\[
 \Pr\bb{ T_{\ceil{\eps^{-2}},2\ceil{\eps^{-2}}}( \Hrnp\setminus\cL_1) \le c \eps^3 n \mid L_1=s, N_1=t } = o(1),
\]
where $T_{k,k'}(H)$ denotes the number of tree components of a hypergraph $H$
having at least $k$ and at most $k'$ edges.
\end{corollary}
\begin{proof}
Let $H'=\Hrnsp$ as before and, ignoring the rounding to integers,
let $T=T_{\eps^{-2},2\eps^{-2}}(H')$.
By Lemma~\ref{dual2}, applied with $\cP$ the set of all $s$-vertex hypergraphs with nullity $t$,
it suffices to find a constant $c$ such that $\Pr(T\le c\eps^3n)=o(1)$.
Defining $\mu_k$ and $\mu_{k,\ell}$ as in Lemma~\ref{smalltree}, by that lemma we have
\[
 \E[T] = \sum_{k=\eps^{-2}}^{2\eps^{-2}} \mu_k = \Theta(\eps^{-2}n(\eps^{-2})^{-5/2}) = \Theta(\eps^3n),
\]
and
\[
 \E[T(T-1)] = \sum_{k=\eps^{-2}}^{2\eps^{-2}} \sum_{\ell=\eps^{-2}}^{2\eps^{-2}} \mu_{k,\ell} \sim
 \sum_{k,\ell}\mu_k\mu_\ell = \E[T]^2.
\]
Since $\E[T]\to\infty$, it follows that $\E[T^2]\sim \E[T]^2$, and hence (by Chebyshev's inequality)
that $T\ge 0.99 \E[T]$ whp, giving the result.
\end{proof}

We shall need some further, simpler results about the part of $\Hrnp$ lying outside the giant component.
The first concerns (essentially) the sum of the squares of the component sizes; it
is perhaps in the literature, but since it is immediate, we give a proof for completeness.
Given a hypergraph $H$,
let $\Nc(H)$ denote the number of (ordered) pairs of (not necessarily distinct) vertices
$(v,w)$ of $H$ with the property
that $v$ and $w$ are connected by a path, i.e., are in the same component.

\begin{lemma}\label{Ncon}
Suppose that our Weak Assumption~\ref{A1} holds,
let $s=s(n)\in\range$ and $t=t(n)\ge 0$. Then
$\E[\Nc(\Hrnsp)]=O(n/\eps)$ and
\[
 \E\bigl[ \Nc(\Hrnp\setminus\cL_1) \mid L_1=s, N_1=t \bigr] = O(n/\eps).
\]
\end{lemma}
\begin{proof}
By Lemma~\ref{dual2} it suffices to prove the first statement.
Let $H'=\Hrnsp$ and, for $\ell\ge 0$, let
$J_\ell$ be the number of ordered pairs of vertices $v,w\in H'$
joined by a path in $H'$ of length $\ell$, so $\Nc(H')\le\sum_\ell J_\ell$. Set $m=n-s$.
Writing a $v$--$w$ path of length $\ell$ as $v_0 e_1 v_1 e_2\cdots e_\ell v_\ell$, where
the $v_i$ are distinct vertices and the $e_i$ distinct hyperedges with
$v_0=v$, $v_\ell=w$ and $e_i$ containing $v_{i-1}$ and $v_i$, there are at most
$m^{\ell+1}$ choices for the $v_i$, then at most
$\binom{m}{r-2}$ ways of extending each pair $v_{i-1}v_i$ to a hyperedge;
to obtain a path these edges must be distinct, so the probability that all are present
is $p^{\ell}$. Hence,
\[
 \E[J_\ell] \le  m^{\ell+1} \frac{m^{(r-2)\ell}}{(r-2)!^\ell} p^\ell
 = m\left(\frac{m^{r-1}p}{(r-2)!}\right)^\ell
 = m \la(H')^\ell,
\]
where $\la(H')$ is the `branching factor' of $H'=\Hrnsp$, defined by \eqref{bfdef}.
By Lemma~\ref{dual1}, $\la(H')=1-\Theta(\eps)$, so summing over $\ell$ we see that
\[
 \E[\Nc(H')] \le m (1-\la(H'))^{-1} = O(n/\eps),
\]
as claimed.
\end{proof}

By similar arguments, we can show that the expected number of vertices  on cycles
is $O(\eps^{-1})$, and that the expected number of vertices in components containing
cycles is $O(\eps^{-2})$.

We finish this section by considering \emph{complex} components, i.e., ones with nullity
at least $2$. Karo\'nski and \L uczak~\cite{KL_giant} prove a version of the following
lemma
for the `size model' $\Hrnm$. We give a (more detailed) proof for $\Hrnp$ for completeness.

\begin{lemma}\label{lcx}
Suppose that our Weak Assumption~\ref{A1} holds.
For any $s=s(n)\in\range$, the expected number of complex components of $H'=\Hrnsp$
is $O(1/(\eps^3n))=o(1)$.
\end{lemma}
\begin{proof}
Writing $\GI(H)$ for the bipartite vertex-edge incidence graph of a hypergraph $H$, it is
easy to check that $n(H)=n(\GI(H))$. A minimal connected graph with nullity at least $2$ clearly
has nullity exactly $2$ (otherwise delete an edge in a cycle), and is easily seen to be either
a $\theta$-graph, consisting of two distinct vertices joined by three internally
vertex-disjoint paths, or a dumbbell, i.e., two edge-disjoint cycles connected
by a path of length at least 0. (The cycles are vertex-disjoint
unless the connecting path has length $0$.) Up to isomorphism, there are $O(\ell^2)$
such graphs with $\ell$ edges: having chosen whether the graph is of the $\theta$ or
dumbbell type, it is specified by choosing the lengths of three paths/cycles,
constrained to sum to $\ell$.

Let $\cG_\ell$ denote the set of isomorphism classes of $\ell$-edge bipartite graphs
of the form above, where we distinguish the vertex class $A$ corresponding
to hypergraph vertices from the class $B$ corresponding to hypergraph edges;
thus $|\cG_\ell|=O(\ell^2)$. If $H$ is a connected hypergraph with $n(H)\ge 2$, then $n(\GI(H))\ge 2$,
so $\GI(H)$ contains some $G\in \bigcup_\ell \cG_\ell$ as a subgraph. If
$G$ has vertex partition $A\cup B$, with $A=\{a_1,\ldots,a_k\}$ and $B=\{b_1,\ldots,b_t\}$,
then in particular $H$ has a subgraph $H_0$ consisting of $t$ hyperedges
with $\GI(H_0)$ containing $G$ as a subgraph. Fixing $G$ for the moment, let
us estimate the expected number of such subgraphs $H_0$ present in $H'=\Hrnsp$.

Writing $m=n-s$, there are $m(m-1)\ldots (m-k+1)\le m^k$ choices for the vertices
of $H'$ corresponding to $a_1,\ldots,a_k$. Let $d_i$ be the degree of $b_i$ in $G$.
For each $1\le i\le t$ we must choose
$r-d_i$ further vertices (other than those already specified by the neighbours
of $b_i$ in $G$) to complete the hyperedge corresponding to $b_i$. For each $i$ there
are at most $m^{r-d_i}/(r-d_i)!$ ways of doing this. Since all but at most two
vertices of $G$ have degree two, and $\sum_i d_i=e(G)=\ell$, this gives in total
\[
 \Theta\left(\frac{m^{rt-\ell}}{(r-2)!^t}\right)
\]
choices.
Finally, the probability that the resulting subgraph $H_0$ is present in $H'$
is exactly $p^t$. Hence, the expected number of such subgraphs $H_0$ corresponding
to a particular $G$ is bounded by a constant factor times
\[
 \frac{m^{k+rt-\ell}}{(r-2)!^t} p^t = m^{k+t-\ell} \left(\frac{m^{r-1}p}{(r-2)!}\right)^t
 = m^{-1} \la(H')^t,
\]
where in the last step we used the fact that $G$ has nullity $2$, so $k+t-\ell=|G|-e(G)=-1$,
and the definition of the branching factor $\la(H')$.

Since $G$ has either two vertices of degree $3$ or one of degree $4$, and all other
vertices have degree $2$, we have $2t\le \ell=\sum_i d_i\le 2t+2$. Hence $t\ge \ell/2-1$.
Thus, summing over the $O(\ell^2)$ choices of $G\in G_\ell$ and then over $\ell$ we see that
the expectation $\mu$ of number of complex components of $H'$ satisfies
\[
 \mu = O\left(\sum_\ell m^{-1}\ell^2 \la(H')^{\ell/2-1}\right).
\]
Now $\la(H')=1-\Theta(\eps)$ by Lemma~\ref{dual1}; hence $\la(H')^{1/2}=1-\Theta(\eps)$.
Since
\[
 \sum_\ell \ell^2 x^\ell\le 2\sum (\ell+1)(\ell+2)x^\ell/2 = 2(1-x)^{-3},
\]
it follows that
$
 \mu = O(m^{-1}\eps^{-3}) = O(1/(\eps^3n)),
$
as claimed.
\end{proof}

Of course, instead of considering vertex-edge incidence graphs, we could directly count
the expected number of minimal complex hypergraphs present in $\Hrnsp$. However, there are significantly
more classes of minimal complex hypergraphs than minimal complex graphs, because
the special (degree more than two) vertices of the corresponding bipartite incidence graph
may correspond to vertices or edges of the hypergraph.

\begin{lemma}\label{C1unique}
Suppose that our Weak Assumption~\ref{A1} holds.
Let $\cU$ be the event that $\cL_1$ is the unique complex component of $\Hrnp$.
Then for any $s=s(n)\in \range$ and $t\ge 2$ we have
\[
 \Pr\bb{ \cU^\cc \mid L_1=s, N_1=t } = O(1/(\eps^3n)).
\]
Furthermore, the probability that $\Hrnp\setminus\cL_1$ has a complex component is $O(1/(\eps^3 n))$.
\end{lemma}

\begin{proof}
Let $\cE$ be the event that $\Hrnp\setminus\cL_1$ has at least one complex component.
By Lemmas~\ref{dual2} and~\ref{lcx}, for $s\in\range$ and $t'\ge 0$ we have
\begin{equation}\label{ccx}
 \Pr\bb{ \cE \mid L_1=s, N_1=t' }=O(1/(\eps^3n)).
\end{equation}
Since $N_1=t\ge 2$ implies that $\cL_1$ is complex,
the first statement follows.

Since \eqref{ccx} holds for all $t'$, for any $s\in\range$ we have
\[
 \Pr(\cE\mid L_1=s)=O(1/(\eps^3n)).
\]
Recalling from \eqref{rangewvhp} that
$\Pr(L_1\notin\range)=O(1/(\eps^3 n))$,
it follows that $\Pr(\cE)=O(1/(\eps^3n))$.
\end{proof}

\section{Extended cores in hypergraphs}\label{sec_ext}

The strategy of our proof of Theorem~\ref{thprob} is as follows.
We shall randomly mark a small (order $\eps^2$) fraction of the vertices of $H=\Hrnp$,
and define the \emph{extended core} $C^+(H)$ by repeatedly deleting edges in which at least $r-1$ vertices
are unmarked and are contained in no other edges.
We shall show that, conditional on the event $\{L_1=s, N_1=t\}$, where
$s$ and $t$ are in the typical range,
certain events are likely to hold. In particular, it is likely that the largest
component $\eco$ of $C^+(H)$ is a subgraph of the largest component of $H$, that the number
$a_1$ of vertices in $\eco$ is $\Theta(\eps^2 n)$, and that the number $a_0$ of isolated
vertices in $C^+(H)\setminus \eco$ is also $\Theta(\eps^2 n)$. We condition on $C^+(H)$, and
pick $a=\min\{a_0,a_1\}$ vertices of $\eco$ and $a$ isolated vertices of $C^+(H)\setminus \eco$.
We also condition on the set $V$ of vertices joined by paths in $H$ to the selected vertices,
showing that with high probability $|V|=\Theta(\eps n)$. Then we show that the conditional
distribution of the number of vertices in $V$ that are joined by paths to $\eco$ has a smooth distribution;
it is this number that plays the role that $Y_n$ plays in the proof of Theorem~\ref{th_eg}.

By the \emph{core} $\core(H)$ of a hypergraph $H$ we mean the (possibly empty)
hypergraph formed from $H$ by repeatedly deleting isolated vertices and
hyperedges $e$ in which at most one vertex is in a hyperedge other than
$e$. Equivalently, $\core(H)$ is the maximal sub-hypergraph of $H$ without
isolated vertices in which every
edge contains at least two vertices in other hyperedges.  Note that this is only
one of several possible generalizations of the concept of the core
of a graph~\cite{BBkcore}; another natural possibility is to take the maximal
sub-hypergraph with minimum degree at least $2$. A hypergraph $H$ consists of its
core, tree components, and the `mantle', made up of
trees each of which meets the core in a single vertex. It is a part of the mantle that
we shall use in our smoothing argument.

Note that the core of $H$ and that of its bipartite vertex--edge incidence
graph $\GI(H)$ correspond in a natural way, except that in the latter,
any vertices corresponding to vertices of $\core(H)$ that are in a single
edge of $\core(H)$ are deleted.

As discussed in Section~\ref{sec_example}, we would like to `detach and reattach' the trees attached
not only to the core, but also to an additional set of vertices of comparable size. To achieve
this, we define an `extended core', essentially by artificially placing a suitable number of extra
vertices into the core; we shall call these vertices `marked' vertices.

Let $(H,M)$ be a \emph{marked hypergraph}: a hypergraph $(V,E)$ together
with a subset $M$ of $V$. The vertices in $M$ will be called \emph{marked vertices}.
The \emph{extended core} $\excore(H,M)$ is the marked sub-hypergraph obtained by repeatedly deleting
unmarked isolated vertices, and hyperedges in which all or all but one vertices
are unmarked and have degree $1$. Equivalently, $\excore(H,M)$ is the maximal
sub-hypergraph in which every edge contains at least two vertices that are either
marked or in at least one other edge, and all isolated vertices are marked.

In this section and the next it will be convenient (though not essential) to assume
that $\eps\to 0$. Thus we assume our Standard Assumption~\ref{A0}.

We shall mark the vertices of our random hypergraph $H=\Hrnp$ independently with probability
\[
 p_{\rm{mark}} = \alpha \eps^2 = \alpha \eps(n)^2
\]
for some small constant $\alpha$.
In what follows $\eta>0$ is a constant (playing the role of a maximum
acceptable error probability), and we set
\begin{equation}\label{alphadef}
 \alpha = \alpha(\eta) = \frac{\eta}{100r},
\end{equation}
say.

We shall treat $\Hrnp$ as a marked hypergraph without
explicitly indicating the set $M$ of marked vertices in the notation. Note that
the extended core of any connected hypergraph is either connected or empty. (The deletion
operations in the construction clearly do not affect connectivity.)
Let $\excore(\cL_1)$ be the component of $\excore(\Hrnp)$ lying inside
the largest component $\cL_1$ of $\Hrnp$. Recall that $L_1=|\cL_1|$. The next few lemmas gather
properties of $\excore(\Hrnp)$ and its `mantle' that we shall need.
A key point is that these results hold conditional on the giant
component $\cL_1$ having a specific order $s$ and nullity $t$, provided $s$ is in the typical
range $\range$ defined in \eqref{rangedef}.  For this reason
they do not obviously follow from `global' results saying that whp the
(extended) core has some property. Another key point
is that we can afford to give up constant factors in the estimates
of the size of the extended core and of its mantle. Throughout the rest of this section,
$p$, $\la$ and $\eps$ satisfy our Standard Assumption~\ref{A0}, and we define $\range$
as in \eqref{rangedef}.

\begin{lemma}\label{ecbig}
Let $\eta>0$ be constant. There is a constant $c_1=c_1(\eta)>0$ such that,
for $n$ large enough, for any $s=s(n)\in \range$
and $t=t(n)\ge 1$ we have
\[
 \Pr\bb{ |\excore(\cL_1)| > c_1\eps^2n \mid L_1=s, N_1=t } \ge 1-\eta.
\]
\end{lemma}
\begin{proof}
We shall condition not only on $L_1$ and on $N_1$, but also on the vertex set of $\cL_1$
and on the entire hypergraph structure of the core $C(\cL_1)$. The extended
core contains the core; if the core is not already large enough, we shall show
that with conditional probability at least $1-\eta$, the interaction of the
marked vertices with the core generates an extended core of at least the required size.

Let $a=|\core(\cL_1)|$
be the number of vertices in the usual (non-extended) core of $\cL_1$.
From now on we condition on the vertex set of $\cL_1$ and on the hypergraph
$\core(\cL_1)$; it suffices to prove that the conditional probability that $|\excore(\cL_1)|\le c_1\eps^2n$
is at most $\eta$. Since $\cL_1$ and $\core(\cL_1)$ have the same nullity,
we may assume that $\core(\cL_1)$ has nullity $t$; in fact, we only
need the trivial consequence that $\core(\cL_1)$ is not empty.\footnote{%
In proving Theorem~\ref{thL1only}, we do not condition on the nullity $n(\cL_1)$.
This means we cannot \emph{a priori} assume that $\core(\cL_1)$ is non-empty. However, it is immediate
from the formulae given by Karo\'nski and \L uczak~\cite[Theorem 9]{KL_sparse} for the number of
connected hypergraphs on $s$ vertices with a given small excess
that $\Pr(n(\cL_1)=0\mid L_1=s)=o(\Pr(n(\cL_1)=r-1\mid L_1=s))$, so $\Pr(n(\cL_1)=0\mid L_1=s)=o(1)$.
Hence we can indeed assume that $a\ge 1$.}
Since $\excore(\cL_1)\supset \core(\cL_1)$, we may assume that
\begin{equation}\label{asmall}
 1\le a\le c_1\eps^2n,
\end{equation}
as otherwise there is nothing to prove.

Relabelling, let us take the vertex set of $\cL_1$ to be $[s]$ and that of its
core to be $[a]\subset [s]$. From the definition of the core, $\cL_1$
is the union of its core and an $[a]$-rooted $r$-forest $F$ on $[s]$.
Since this forest $F$ does not affect the core, after conditioning as above,
$F$ is uniformly random on all such forests.

Set $\ell=\ceil{\eps^{-1}}$.
Call a marked vertex $v\in \cL_1$ \emph{bad} if either

\smallskip
(i) it is at distance at most $\ell$ from $[a]=V(\core(\cL_1))$ or

(ii) it is joined to another marked vertex by a path in $F=\cL_1-C(\cL_1)$ of length
at most $2\ell$.

\smallskip\noindent
If $v$ is not bad, we call it \emph{good}.

Every marked vertex in $\cL_1$ is on a path to the core, and $\excore(\cL_1)$ consists
of the core together with the union of these paths. For each good marked vertex $v$, consider the first
$\ell$ edges of the path to the core starting at $v$: these shortened paths
are necessarily disjoint, so $|\excore(\cL_1)|$ is at least $\ell$
times (in fact, at least $(r-1)\ell$ times) the number of good marked vertices.
Recall that we mark vertices independently with probability $\alpha\eps^2$, where $\alpha$ is given
in \eqref{alphadef}. Since $s=\Theta(\eps n)$,
we have $\alpha\eps^2s=\Theta(\eps^3n)\to\infty$.
As the number of marked vertices in $\cL_1$ has the binomial distribution $\Bi(s,\alpha\eps^2)$,
it follows that whp there are at least $\alpha\eps^2s/2$ marked vertices in $\cL_1$.
We \emph{claim} that
the expected number of bad marked vertices is at most $\eta\alpha\eps^2s/8$.
Assuming this then, by Markov's inequality, with probability at least $1-\eta/2$
there are at most $\alpha\eps^2s/4$ bad marked vertices, and hence with
probability at least $1-\eta$ there are
at least $\alpha\eps^2s/2-\alpha\eps^2s/4=\alpha\eps^2s/4$ good marked vertices. But then
\[
 |\excore(\cL_1)|\ge \ell\alpha\eps^2s/4 \ge \alpha\eps s/4.
\]
Since $s=\Theta(\eps n)$, this gives $|\excore(\cL_1)|\ge c_1\eps^2 n$ if $c_1$
is chosen small enough.

To prove the claim, let $v$ be a vertex of $[s]$ chosen uniformly at random.
We must show that
the probability that $v$ is a bad marked vertex is $\le \eta\alpha\eps^2/8$.
So first condition on the event that $v$ is marked; it remains to show that the conditional
probability that (i) or (ii) holds is at most $\eta/8$.

For (i), this conditional probability is exactly $1/s$ times the expectation $\mu$
of the number of vertices
within distance $\ell$ of $[a]$. By Lemma~\ref{l_dt} and \eqref{asmall},
\[
 \mu \le \sum_{0\le j\le \ell} (a+(r-1)j) = O(a\ell+\ell^2) = O(c_1\eps n+\eps^{-2}) = O(c_1\eps n),
\]
recalling that $\eps^3 n\to\infty$ and $c_1$ is constant. Since $s\in\range$ implies $s=\Omega(\eps n)$,
we have $\mu/s=O(c_1)$, so choosing $c_1$ small enough we certainly have $\mu/s\le \eta/16$.

For (ii), the components of the forest $F$ give a partition of the vertex set $[s]$ of $\cL_1$
into $a$ parts (some of which may be singletons). Let us condition on the vertex $v$
and on this partition. The component $T$ of $F$ containing $v$ is then a uniformly random $r$-tree
on its vertex set $X$. Viewing $v$ as the root, we can regard this $r$-tree
as a $\{v\}$-rooted $r$-forest, and then by Lemma~\ref{l_dt} the expected number of
vertices $w\ne v$ joined to $v$ by paths in $F$ (and hence in $T$) of length at most $2\ell$ is at most
\[
 \sum_{1\le j\le 2\ell} (1+(r-1)j) \le 4r\ell^2 = 4r\ceil{1/\eps}^2.
\]
Hence the probability that one or more such vertices are marked is at most
$4r\ceil{1/\eps}^2\alpha\eps^2$. Since $\eps\to 0$, for $n$
large enough this probability is at most $\eta/16$ by \eqref{alphadef}.
\end{proof}

We have shown that with high (conditional) probability, the extended core $\excore(\cL_1)$ of the largest
component is not too small. Roughly speaking, our next aim is to
show that with high probability the rest of the extended core,
i.e., $\excore(\Hrnp)\setminus \excore(\cL_1) = \excore(\Hrnp\setminus \cL_1)$ is neither too small
nor too big. While this is not too hard, it turns out that we can avoid some work
by considering instead the set
\[
 \cI = \{ \hbox{ isolated vertices in the hypergraph  }\excore(\Hrnp\setminus\cL_1)\ \}.
\]
Note that each $v\in \cI$ corresponds to a tree component of $\Hrnp\setminus\cL_1$ containing
exactly one marked vertex, namely $v$.

\begin{lemma}\label{isolcore}
For any constant $\eta>0$ there is a constant $c_2=c_2(\eta)>0$ such that,
for any $s=s(n)\in\range$ and $t=t(n)\ge 0$,
\[
 \Pr\bb{ c_2\eps^2n \le |\cI| \le 2\alpha\eps^2n \mid L_1=s, N_1=t } =1-o(1).
\]
\end{lemma}
\begin{proof}
The upper bound on $|\cI|$ is trivial.
Indeed, any vertex of $\cI$ is marked, by the definition of the extended core.
Given that $L_1=s$, and any further information about $\cL_1$,
the number of marked vertices in $\Hrnp\setminus \cL_1$
has the binomial distribution $\Bi(n-s,\alpha\eps^2)$, with mean at most $\alpha\eps^2n\to\infty$, so
with high probability this number is at most $2\alpha\eps^2n$.

Turning to the lower bound, by Lemma~\ref{dual2} it suffices to show that whp $H'=\Hrnsp$
(with vertices marked independently with probability $\alpha\eps^2$) has at least $c_2\eps^2n$
isolated vertices in its extended core. An elementary first and second moment calculation (or the
case $k=0$ of Lemma~\ref{smalltree}) shows that whp $H'$ has $\Theta(n)$ isolated vertices.
Since each is marked independently with probability $\alpha\eps^2$ and, if marked, is
an isolated vertex of $\excore(H')$, the result follows from concentration of the binomial distribution.
\end{proof}

Let $H$ be a hypergraph with extended core $\excore(H)$. We define the \emph{mantle} $M^+(H)$
to be the set of vertices of $H$ not in $\excore(H)$ but connected to it by paths. Thus
$\excore(H)\cup M^+(H)$ includes all vertices of $H$ except those in tree components
with no marked vertices; note that $M^+(H)$ is a subset of the mantle associated to the
non-extended core. Each $v\in M^+(H)$ is connected by a path in the mantle to a unique
vertex $x\in \excore(H)$; for $A\subset V(\excore(H))$ we write $M^+(A)$ for the set of $v\in M^+(H)$
whose corresponding core vertex $x$ is in $A$.

\begin{lemma}\label{isolml}
For any constant $\eta>0$ there is a constant $c_3=c_3(\eta)>0$ such that,
for any $s\in\range$ and $t\ge 0$, we have
\[
 \Pr( |M^+(\cI)| \ge c_3\eps n\mid L_1=s, N_1=t)=1-o(1).
\]
\end{lemma}
\begin{proof}
Condition on the event that $L_1=s$ and $N_1=t$.
From Corollary~\ref{csmallt}, with conditional probability $1-o(1)$ the hypergraph
$\Hrnp\setminus\cL_1$ contains at least $c\eps^3n$ tree components
each having between $\ceil{\eps^{-2}}$ and $2\ceil{\eps^{-2}}$ edges, and so $\Theta(\eps^{-2})$
vertices. Having revealed the graph $\Hrnp$,
for each such tree, the probability that it contains exactly one marked vertex is at least some
constant $c'>0$. So the conditional distribution of the number $X$ of such trees containing
exactly one marked vertex stochastically
dominates a Binomial distribution with mean $cc'\eps^3n$. Since $\eps^3n\to\infty$,
it follows that whp $X\ge cc'\eps^3n/2$. Since each tree counted by $X$ contains at least
$1+(r-1)\ceil{\eps^{-2}}$
vertices, and so contributes at least $(r-1)\ceil{\eps^{-2}}\ge\eps^{-2}$
vertices to $M^+(\cI)$, the result follows.
\end{proof}

\begin{lemma}\label{isolmu}
For any constant $\eta>0$ there exists a constant $c_4=c_4(\eta)$ such that, for $n$ large enough,
for every $s\in\range$ and $t\ge 0$ we have
\[
 \Pr\bb{ |M^+(\cI)| \le c_4\eps n\mid L_1=s, N_1=t } \ge 1-\eta.
\]
\end{lemma}
\begin{proof}
Given a marked hypergraph $H$, let $X(H)$ denote the number of vertices $v$ of $H$
with the property that $v$ is joined to some marked vertex of $H$ by a path in $H$.
Note that every vertex of $M^+(\cI)$ has this property in $H^-=\Hrnp\setminus\cL_1$,
so $|M^+(\cI)|\le X(H^-)$. Hence, by Markov's inequality,
it suffices to show that $\E[X(H^-)\mid L_1=s, N_1=t] = O(\eps n)$.
Now $X(H^-)$ is at most the number of ordered pairs $(v,w)$ of vertices of
$H^-$ with $v$ marked and $v$, $w$ joined by a path,
so
\[
 \E[X(H^-)\mid L_1=s, N_1=t]\le \alpha\eps^2\E[\Nc(H^-)\mid L_1=s, N_1=t]
\]
which, by Lemma~\ref{Ncon}, is $O(\eps^2 n/\eps)=O(\eps n)$.
\end{proof}

\section{The core smoothing argument}\label{sec_main}

In this section we prove Theorem~\ref{thL1}; this is all that remains to complete
the proof of Theorem~\ref{thprob}. The strategy that we follow is outlined at the start of Section~\ref{sec_ext}.

\begin{proof}[Proof of Theorem~\ref{thL1}]
Throughout we fix the function $p(n)$ (and hence $\eps(n)$) and the sequences $(x_n)$, $(y_n)$ and $(t_n)$.
Recall that by assumption $p(n)=(1+\eps)(r-2)!n^{-r+1}$ where $\eps=\eps(n)\to 0$ and $\eps^3n\to\infty$;
also $t_n\ge 2$, and $x_n,y_n\in\range$ with $x_n-y_n=o(\sqrt{n/\eps})$ and $x_n\equiv y_n\equiv 1-t_n$
modulo $r-1$. (The congruence condition is necessary since otherwise there are no
$r$-uniform hypergraphs with nullity $t_n$ and $x_n$ or $y_n$ vertices.)
Our aim is to show that
\begin{equation}\label{L1diff2}
 \Pr(L_1=x_n, N_1=t_n)-\Pr(L_1=y_n, N_1=t_n) = o(1/(\eps n)).
\end{equation}

We \emph{claim} that for any constant $0<\eta<1/100$ the following two assertions hold,
where $1\pm\delta$ denotes a quantity in the range $[1-\delta,1+\delta]$:
\begin{equation}\label{etaapp}
 \Pr(L_1=x_n, N_1=t_n) = (1\pm 30\eta)\bb{\Pr(L_1=y_n, N_1=t_n)+o(1/(\eps n))},
\end{equation}
and
\begin{equation}\label{bigo}
 \Pr(L_1=y_n, N_1=t_n) = O(1/(\eps n)),
\end{equation}
where the implicit constant may depend on $\eta$. Assuming this for the moment, let us
show that the result follows.

Firstly, since $\eta$ is arbitrary, \eqref{etaapp} implies that
\[
 \Pr(L_1=x_n, N_1=t_n) = (1+o(1))\bb{\Pr(L_1=y_n, N_1=t_n)+o(1/(\eps n))}.
\]
From \eqref{bigo}, applied with our favourite value of $\eta$,
we have $\Pr(L_1=y_n, N_1=t_n)=O(1/(\eps n))$,
so \eqref{L1diff2} follows.

It remains to prove the claim. From now on we fix $0<\eta<1/100$.

Define the largest component $\cL_1$ of $\Hrnp$ as before,
and the extended core $\excore(\Hrnp)$ and the set $\cI$ as in Section~\ref{sec_ext}.
Define $\range$ as in \eqref{rangedef}. Since $\rho_{r,\la}=\Theta(\eps)$ there
are constants $c_0$ and $c_5$ such that, for $n$ large,
\[
 \range = [(1-\delta)\rho_{r,\la}n,(1+\delta)\rho_{r,\la}n] \subset [c_0\eps n,c_5\eps n].
\]
Set
\[
 c=\min\{c_0,c_1,c_2,c_3\}\hbox{\quad and\quad} C=\max\{c_4,c_5\},
\]
where the constants $c_i$, $1\le i\le 4$, are as in Lemmas~\ref{ecbig}--\ref{isolmu}.

Let $\cA$ be the event that the following conditions hold:

\smallskip
(i) $|\excore(\cL_1)|\ge c\eps^2 n$,

(ii) $c\eps^2n \le |\cI| \le 2\alpha\eps^2 n$,

(iii) $|M^+(\cI)|\ge c\eps n$,

(iv) $|M^+(\cI)|\le C\eps n$ and

(v) $c\eps n \le |\excore(\cL_1)|+|M^+(\excore(\cL_1))|\le C\eps n$.

\smallskip\noindent
We claim that, for $n$ sufficiently large,
for any $s\in\range$ and any $t\ge 2$ we have
\begin{equation}\label{cpA}
 \Pr( \cA \mid L_1=s, N_1=t )\ge 1-3\eta,
\end{equation}
say. Indeed, Lemmas~\ref{ecbig}, \ref{isolcore}, \ref{isolml} and~\ref{isolmu} imply that properties
(i)--(iv) hold with conditional probability at least $1-(2\eta+o(1))\ge 1-3\eta$ for $n$ large.
Property (v) holds with conditional probability $1$,
since $|\excore(\cL_1)|+|M^+(\excore(\cL_1))|=|\cL_1|=L_1=s\in\range$.

Let $\eco$ be the component of $\excore(\Hrnp)$ with the highest nullity/excess,
chosen according to any fixed rule if there is a tie.
(By Lemma~\ref{C1unique}, whp there will not be a tie.)
Let $\cI'$ be the set of isolated vertices of $\excore(\Hrnp)\setminus \eco$.
As before, let $\cU$ be the event that $\cL_1$ is the unique complex component of $\Hrnp$;
note that if $\cU$ holds, then $\eco=\excore(\cL_1)$ and so $\cI'=\cI$.
We shall define an event $\cB$ that is closely related to $\cA$,
but defined using $\eco$ and $\cI'$ in place of $\cC_1$ and $\cI$. The point is that when we
come to condition on the extended core (and some further information), we wish to use
the remaining randomness concerning which parts of the mantle are joined to the largest
component in our smoothing argument. But until this remaining randomness has been revealed,
we do not know which component is largest, so we cannot easily condition on $\cA$.

Let $a_1=|\eco|$, $a_0=|\cI'|$, and $a=\min\{a_1,a_0\}$. Given the entire extended core,
pick sets $A_1\subset V(\eco)$ and $A_0\subset\cI'$ with $|A_1|=|A_0|=a$, for example
by choosing in each case the first $a$ eligible vertices in a fixed order. (This is
mostly a convenience; with a little more work we could work directly with $\eco$ and $\cI'$.)
Let $\cB$ be the event that the following hold:

\smallskip
(I) $c\eps^2 n\le a\le 2\alpha\eps^2n$,

(II) $c\eps n/2 \le |M^+(A_1\cup A_0)| \le 2C\eps n$.

\smallskip
We claim that whenever $\cA\cap\cU$ holds, so does $\cB$. To see this, suppose that $\cA\cap \cU$
holds. Then, since $\cU$ holds, $\eco=\excore(\cL_1)$. Since $|\excore(\cL_1)|\ge c\eps^2n$ by
condition (i) of $\cA$, we have $a_1\ge c\eps^2n$. Also, $a_0=|\cI'|=|\cI|$ is between $c\eps^2n$
and $2\alpha\eps^2n$ by (ii). Since $a=\min\{a_1,a_0\}$, this gives (I). Consider next the upper
bound in (II). Since $\cU$ holds, $A_1\cup A_0\subset \eco\cup\cI' = \excore(\cL_1)\cup \cI$,
so $M^+(A_1\cup A_0)\subset M^+(\excore(\cL_1))\cup M^+(\cI)$, and
(iv) and (v) imply $|M^+(A_1\cup A_0)|\le 2C\eps n$.
For the lower bound we have two cases: if $a_0\le a_1$ then $A_0=\cI'=\cI$
so $|M^+(A_1\cup A_0)|\ge |M^+(A_0)|=|M^+(\cI)|\ge c\eps n$ by (iii).
If $a_1\le a_0$ then $A_1=\eco=\excore(\cL_1)$, so from (v) we have
\[
 |M^+(A_1\cup A_0)|\ge |M^+(\excore(\cL_1))| \ge c\eps n-a_1
 = c\eps n-a \ge c\eps n-2\alpha\eps^2n,
\]
by (I). Since $\alpha\le 1$ and $\eps\to 0$,
if $n$ is large enough then it follows
that $|M^+(A_1\cup A_0)| \ge c\eps n/2$, so (II) holds.

For any $s\in\range$ and $t\ge 2$, by Lemma~\ref{C1unique},
\begin{equation}\label{Ulikely}
  \Pr(\cU\mid L_1=s, N_1=t)=1-o(1).
\end{equation}
Since $\cA\cap\cU$ implies $\cB$, it follows from this and \eqref{cpA}
that, if $n$ is large enough, then
\begin{equation}\label{cpBU}
 \Pr(\cB\cap \cU\mid L_1=s, N_1=t)\ge 1-4\eta.
\end{equation}
Hence,
\begin{equation}\label{PB}
 \Pr(\cB)\ge \Pr(\cB\cap \cU) \ge (1-4\eta)\Pr(L_1\in\range,\,N_1\ge 2) \ge 1-5\eta \ge 1/2,
\end{equation}
where in the second last step we used that $L_1\in\range$ whp (from \eqref{rangewhp})
and that $N_1\ge 2$ whp, an immediate consequence of Theorem~\ref{thglobal2}.

We now have the pieces in place to complete the proof of Theorem~\ref{thL1}.
We first reveal the following
partial information about our random marked hypergraph $H=\Hrnp$. First reveal $\excore(H)$,
and in particular which vertices are marked. Define $\eco$, $A_1$ and $A_0$ as above, noting that these
depend only on $\excore(H)$. Reveal $M^+(A_1\cup A_0)$, the set of non-core vertices joined
by paths to $A_1\cup A_0$. Also (although this is not necessary), reveal all hyperedges outside
$\excore(H)\cup M^+(A_1\cup A_0)$. We write $\cF=\cF_n$ for the $\sigma$-algebra generated by the information
revealed so far. Note that the event $\cB$ defined above is $\cF$-measurable.

What have we not yet revealed? Let $F$ be the subgraph of $H$ induced by $V=A_1\cup A_0\cup M^+(A_1\cup A_0)$
with any edges inside $A_1\cup A_0$ removed (these removed edges are in $\excore(H)$.
By the definition of $\excore(H)$ and of $M^+(A_1\cup A_0)$, the hypergraph $F$ is an $(A_1\cup A_0)$-rooted
$r$-forest on $V$. Moreover, replacing one such forest with another does not affect $\excore(H)$,
or indeed any information revealed earlier. Thus, conditional on $\cF$, the distribution of $F$
is uniform over all $(A_1\cup A_0)$-rooted $r$-forests on $V$; this uniform choice of the forest
$F$ is the only remaining randomness.

When $\cB$ holds, $|A_1|=|A_0|=a=\Theta(\eps^2 n)$, while $m=e(F)=|M^+(A_1\cup A_0)|/(r-1)=\Theta(\eps n)$.
Since $\eps=O(1)$ we have $m=\Omega(a)$. Also, $a^2/m=\Theta(\eps^3 n)\to\infty$, so $m=o(a^2)$.
Hence the conditions of Lemma~\ref{ldist} are satisfied.
Let $Y_n=|M^+(A_1)|$ be the number of vertices in $V\setminus (A_1\cup A_0)$ joined to $A_1$ (rather than
to $A_0$).
Since $m^{3/2}a^{-1}=\Theta(\sqrt{n/\eps})$,
Lemma~\ref{ldist} tells us that when $\cB$ holds and $x_n'-y_n'=o(\sqrt{n/\eps})$, then
\begin{equation}\label{csmooth}
 \Pr(Y_n = x_n' \mid \cF)-\Pr(Y_n=y_n' \mid \cF) = o(\sqrt{\eps/n})
\end{equation}
and
\begin{equation}\label{csmooth2}
 \Pr(Y_n=y_n'\mid \cF)=O(\sqrt{\eps/n}),
\end{equation}

Let $\cC^*$ be the component of $H=\Hrnp$ containing $\eco$, and let $L^*=|\cC^*|$
and $N^*$ denote the order and nullity of $\cC^*$. Since $\cC^*$ consists of $\eco$
with a forest attached, $N^*$ is also the nullity of $\eco$ and so is an $\cF$-measurable
random variable.
Let $\cE$ denote the event that $\Hrnp\setminus\cL_1$ has a complex component,
so $\{N^*=t_n\}\subset \{N_1=t_n\}\cup\cE$.
Theorem~\ref{thN1} implies that $\Pr(N_1=t_n)=O((\eps^3n)^{-1/2})$.
By the last part of Lemma~\ref{C1unique}, we have $\Pr(\cE)=O(1/(\eps^3n))$, so
\[
  \Pr(N^*=t_n) \le \Pr(N_1=t_n) + \Pr(\cE) = O((\eps^3n)^{-1/2}).
\]
It follows from this and \eqref{PB} that
\begin{multline}\label{N*}
 \Pr(N^*=t_n\mid\cB) = \frac{\Pr(\{N^*=t_n\}\cap \cB)}{\Pr(\cB)} \\
  \le   \frac{\Pr(N^*=t_n)}{\Pr(\cB)} \le  2\Pr(N^*=t_n) = O((\eps^3n)^{-1/2}).
\end{multline}

Given $\cF$, the only uncertainly (i.e., not-yet-revealed information)
affecting $L^*$ is which vertices of $M^+(A_1\cup A_0)$ join to $A_1$
rather than to $A_0$. Thus
we may write $L^*$ as $X_n+Y_n$ where $X_n$ is $\cF$-measurable and $Y_n$ is defined as above.
Hence, when $\cB$ holds,
\begin{multline*}
 \Pr(L^* = x_n \mid \cF)-\Pr(L^*=y_n \mid \cF) \\ =
 \Pr(Y_n = x_n -X_n \mid \cF)-\Pr(Y_n=y_n -X_n \mid \cF) =
 o(\sqrt{\eps/n}),
\end{multline*}
by \eqref{csmooth} with $x_n'=x_n-X_n$ and $y_n'=y_n-X_n$.
Taking the expectation over the $\cF$-measurable
event $\cB\cap\{N^*=t_n\}$, it follows that
\begin{multline}\label{sB}
  \Pr(L^* = x_n, N^*=t_n \mid \cB)-\Pr(L^*=y_n,N^*=t_n \mid \cB) \\
 =  o\bb{\sqrt{\eps/n}\ \Pr(N^*=t_n\mid\cB)}  = o(1/(\eps n)),
\end{multline}
where the last step is from \eqref{N*}.
Similarly, from \eqref{csmooth2} and \eqref{N*} we see that
\begin{equation}\label{sB2}
 \Pr(L^*=y_n, N^*=t_n\mid \cB)=O\bb{\sqrt{\eps/n}\ \Pr(N^*=t_n\mid\cB)} = O(1/(\eps n)).
\end{equation}
It remains to remove the conditioning, and to replace $L^*$ by $L_1$.

Recall that when $\cU$ holds, then $\cC^*=\cL_1$, so $L_1=L^*$ and $N_1=N^*$.
Let $s=s(n)\in\range$, and let $t=t(n)\ge 2$.
If $L^*=s, N^*=t$ and $(L_1,N_1)\ne (s,t)$ then there is a component with
$s$ vertices and nullity $t$ which is not the unique largest component.
By Lemma~\ref{lbigep} (in particular from \eqref{ep2}), we thus have
\[
 \Pr\bb{(L^*,N^*)=(s,t),\,(L_1,N_1)\ne (s,t)} = o\bb{ \Pr((L_1,N_1)=(s,t)) }.
\]
Using \eqref{cpBU} for the first inequality, and
recalling that
\[
 \{L_1=s, N_1=t\}\cap\cB\cap\cU =  \{L^*=s, N^*=t\}\cap\cB\cap\cU,
\]
we have
\begin{eqnarray*}
 (1-4\eta)\Pr(L_1=s, N_1=t)
&\le&  \Pr(\{L_1=s, N_1=t\}\cap \cB\cap\cU)  \\
&=&    \Pr(\{L^*=s, N^*=t\}\cap \cB\cap\cU)  \\
&\le&  \Pr(\{L^*=s, N^*=t\}\cap \cB) \\
&\le&  \Pr(L^*=s, N^*=t) \\
&\le&  \Pr(L_1=s, N_1=t) \\
&&\hskip 1cm +\ \Pr(L^*=s, N^*=t, (L_1,N_1)\ne (s,t))  \\
&=&    (1+o(1))\Pr(L_1=s, N_1=t).
\end{eqnarray*}
Hence, for $n$ large,
\begin{equation}\label{L*N*LN}
 \Pr(\{L^*=s, N^*=t\}\cap \cB) = (1\pm 4\eta)\Pr(L_1=s, N_1=t).
\end{equation}
Relations \eqref{L*N*LN} and \eqref{PB} imply that
\begin{equation}\label{transf}
 \Pr(L^*=s, N^*=t\mid \cB) = \frac{\Pr(\{L^*=s, N^*=t\}\cap \cB)}{\Pr(\cB)} = (1\pm 10\eta) \Pr(L_1=s, N_1=t),
\end{equation}
since $0<\eta<1/50$.
Applying \eqref{transf} (backwards) with $s=x_n$ and $t=t_n$,
then \eqref{sB}, then \eqref{transf} with $s=y_n$ and $t=t_n$, we deduce that
\[
 \Pr(L_1=x_n, N_1=t_n) = (1\pm 10\eta)^{-1}\bb{ (1\pm 10\eta)\Pr(L_1=y_n, N_1=t_n) + o(1/(\eps n)) }.
\]
Since $0<\eta<1/30$ this implies \eqref{etaapp}.
Similarly, from \eqref{transf} and \eqref{sB2} we deduce \eqref{bigo},
completing the proof of Theorem~\ref{thL1}.
\end{proof}

Finally, let us comment briefly on the proof of Theorem~\ref{thL1only}. The arguments in this
section and the previous one can be modified to prove Theorem~\ref{thL1only}, by omitting all conditioning
on $N_1$, and replacing the quantity $1/(\eps n)$ where it appears as the order
of a point probability (for example in \eqref{sB} and \eqref{sB2}) by $\sqrt{\eps/n}$,
which is (within a constant factor) the probability that $L_1$ takes a given typical value.
At almost all points nothing needs to be added to the argument. Two exceptions
are in the proof of Lemma~\ref{ecbig}, and that
in place of \eqref{Ulikely} we need $\Pr(\cU\mid L_1=s)=1-o(1)$.
See the footnote to the proof of Lemma~\ref{ecbig} for an argument covering both of these.

\section{Proof of Theorem~\ref{thenum}}\label{sec_deduce}

In this section we shall deduce Theorem~\ref{thenum} from Theorem~\ref{thprob}. The only additional
result needed for this is Lemma~\ref{lbigep}; however, the formulae are rather messy and we will devote some
space to calculations aimed at simplifying them.

\begin{proof}[Proof of Theorem~\ref{thenum}]
Let $r\ge 2$ be fixed, and suppose that $t=t(s)\to\infty$ as $s\to\infty$;
our aim is to give an asymptotic formula for the number $C_r(s,t)$ of connected
$r$-uniform hypergraphs on $[s]$ having nullity $t$. From \eqref{nulldef} the number
$m$ of edges of any such hypergraph satisfies
\[
 m=\frac{s+t-1}{r-1}.
\]
In particular, we must have $s+t$ congruent to $1$ modulo $r$ for $C_r(s,t)$ to be non-zero. We assume this
from now on. We also assume that $t=o(s)$ and $t\to\infty$; all limits are as $s\to\infty$.

The function $\Psi_r(x)$ defined in \eqref{Prdef}
is continuous on $(0,1)$ and tends to $0$ as $x\to 0$ and to infinity as $x\to 1$.
Also, as mentioned in the introduction, $\Psi_r(x)$ is strictly increasing on $(0,1)$; hence,
for $s$ large enough that $t\ge 2$, the equation
\eqref{rdefc} has a unique positive solution $\rho=\rho(s)$.
Expanding about $x=0$ we see that $\Psi_r(x)=\frac{r-1}{12}x^2+O(x^3)$. Thus
\[
 \rho \sim 2\sqrt{\frac{3}{r-1}\frac{t}{s}}
\]
as $s\to\infty$.

Define
\begin{equation}\label{rr2}
 \rho_2= 1-(1-\rho)^{r-1}
\end{equation}
and
\begin{equation}\label{rla}
 \la = \frac{-\log(1-\rho_2)}{\rho_2} = \frac{-(r-1)\log(1-\rho)}{1-(1-\rho)^{r-1}}.
\end{equation}
Note that $\la>1$; comparing \eqref{rr2} and \eqref{rla} with \eqref{rldef} and \eqref{rkldef}
we see that in the notation of the rest of the paper,
\[
 \rho_2 = \rho_\la=\rho_{2,\la} \hbox{\qquad and\qquad}\rho=\rho_{r,\la}.
\]

As $s\to\infty$ and thus $\rho\to 0$, we have
$\rho_2 \sim (r-1)\rho$. Thus
\[
 \la = 1+\rho_2/2+O(\rho_2^2)
\]
and
\begin{equation}\label{neps}
 \eps=\la-1\sim \frac{\rho_2}{2} \sim \frac{r-1}{2}\rho \sim \sqrt{3(r-1)\frac{t}{s}} \to 0.
\end{equation}

Set
\[
 n=\floor{s/\rho}\hbox{\qquad and\qquad}p=\la\frac{(r-2)!}{n^{r-1}}.
\]
Since $s\to\infty$ and $\rho\to 0$, certainly $n\to\infty$ and $n\sim s/\rho$. Hence,
from \eqref{neps},
\[
 \eps n \sim \frac{r-1}{2} s.
\]
From \eqref{neps} we also have $\eps\to 0$. In addition,
\[
 \eps^3n = \eps^2 (\eps n) = \Theta( (t/s) s)=\Theta(t) \to \infty.
\]
Hence our Standard Assumption~\ref{A0} is satisfied, i.e., we have the conditions needed to apply Theorem~\ref{thprob}.

We have chosen the parameters $n$ and $p$ so that the `typical' order and nullity of the largest
component of $\Hrnp$ will be very close to $s$ and $t$, respectively. More precisely,
for the `typical' number $\rho_{r,\la}n$ of vertices we have
\[
 \rho_{r,\la} n = \rho n = \rho\floor{s/\rho} = s+O(\rho) = s+O(\eps).
\]
For the nullity, recalling \eqref{rhosdef} and \eqref{rla} we see that
the formula \eqref{Prdef} defining $\Psi_r$ may be written as
\begin{equation}\label{Prdef2}
 \Psi_r(\rho_{r,\la})=\rho_{r,\la}^*/\rho_{r,\la}.
\end{equation}
Indeed, this is how we arrived at this formula. Since $\rho_{r,\la}=\rho$ it follows using
\eqref{rdefc} that
\[
 \rho_{r,\la}^* n = \Psi_r(\rho) \rho n = \frac{t-1}s \rho n = t-1+O(\eps^3) = t+O(1).
\]
The standard deviations $\sigma_n$ and $\sigma_n^*$ appearing in Theorem~\ref{thprob} tend to
infinity, so certainly we have $s=\rho_{r,\la}n+o(\sigma_n)$ and $t=\rho_{r,\la}^* n +o(\sigma^*_n)$.
Hence, by Theorem~\ref{thprob}, and in particular the formula \eqref{pp2},
\begin{equation}\label{f1}
 \Pr\bb{ L_1(\Hrnp)=s,\, N_1(\Hrnp)=t } \sim \frac{\sqrt{6}}{8\pi}\frac{(r-1)^2}{\eps n}
 \sim \frac{\sqrt{6}}{4\pi}\frac{r-1}{s}.
\end{equation}
On the other hand, applying Lemma~\ref{lbigep} with $\cQ_s$ the set of all $r$-uniform hypergraphs with
$s$ vertices and nullity $t$, writing $N_{s,t}$ for the number of components of $\Hrnp$
with the property $\cQ_s$, we have
\begin{equation}\label{f2}
 \Pr\bb{ L_1(\Hrnp)=s,\, N_1(\Hrnp)=t } \sim \E[N_{s,t}].
\end{equation}
By linearity of expectation,
\begin{equation}\label{f3}
 \E[N_{s,t}] = \binom{n}{s} C_r(s,t) p^m (1-p)^{\binom{n}{r}-\binom{n-s}{r}-m}.
\end{equation}
Combining \eqref{f1}--\eqref{f3} we see that
\begin{equation}\label{f4}
 C_r(s,t) \sim \frac{\sqrt{6}}{4\pi}\frac{r-1}{s}
 \binom{n}{s}^{-1} p^{-m} (1-p)^{-\left(\binom{n}{r}-\binom{n-s}{r}-m\right)}.
\end{equation}
In the rest of this section
we simplify this formula, in particular by showing that we can replace
$n=\floor{s/\rho}$ by $s/\rho$, for example.

Working in terms of $n$ and $\eps$ (the more familiar parameters from the bulk of the paper) we have
\[
 s=\Theta(\eps n),\quad t=\Theta(\eps^3 n),\quad m=\Theta(\eps n), \quad p=O(n^{-r+1})= O(n^{-1}).
\]
It follows immediately that $pm=o(1)$, so $(1-p)^m\sim 1$.
Also,
\[
 r!\binom{n}{r} = n(n-1)\cdots(n-r+1) = n^r-\binom{r}{2}n^{r-1}+O(n^{r-2})
\]
and
\[
 r!\binom{n-s}{r} = (n-s)^r -\binom{r}{2}(n-s)^{r-1}+O(n^{r-2}) = (n-s)^r - \binom{r}{2} n^{r-1}  + O(sn^{r-2}).
\]
Subtracting, we see that
\[
 \binom{n}{r}-\binom{n-s}{r} = \frac{n^r-(n-s)^r}{r!} + O(sn^{r-2})
 = \frac{n^r-(n-s)^r}{r!} + o(n^{r-1}) = o(n^r).
\]
Since $\log\bb{(1-p)^k}=-pk+O(p^2k)$ it follows easily that
\begin{multline*}
 a= -\log\left( (1-p)^{\binom{n}{r}-\binom{n-s}{r}-m} \right)
  = p\frac{n^r-(n-s)^r}{r!}+o(1) \\
  = \frac{\la n}{r(r-1)}(1-(1-s/n)^r) = \frac{\la s}{r(r-1)} f(s/n)
\end{multline*}
where $f(x)=x^{-1}(1-(1-x)^r)$. Since $f'(x)=O(1)$ for $x=O(1)$ and $s/n-\rho=O(\eps/n)$
we have $f(s/n)-f(\rho)=O(\eps/n)$,  so $sf(s/n)-sf(\rho)=O(\eps^2)=o(1)$.
Hence
\[
 a= \frac{\la s}{r(r-1)}f(\rho)+o(1).
\]
From \eqref{Prdef}, \eqref{rla} and \eqref{rdefc} it follows that
\[
 a = s\frac{\Psi_r(\rho)+1}{r-1} +o(1) =  s\frac{(t-1)/s+1}{r-1} +o(1) = \frac{s+t-1}{r-1} +o(1) = m+o(1).
\]
From \eqref{f4} we now obtain the formula
\[
 C_r(s,t) \sim \frac{\sqrt{6}}{4\pi} \frac{r-1}{s} e^m p^{-m} \binom{n}{s}^{-1}.
\]

By Stirling's formula,
\[
 \binom{n}{s}^{-1} \sim \sqrt{2\pi}\sqrt{\frac{s(n-s)}{n}} \frac{s^s(n-s)^{n-s}}{n^n}
 \sim \sqrt{2\pi s} \left(\frac{s}{n}\right)^s  \left(1-\frac{s}{n}\right)^{n-s}.
\]
Since $s=\rho n+O(\eps)$, we have $s/n=\rho(1+O(1/n))$. Also, $1-s/n=(1-\rho)(1+O(\eps/n))$, and it follows
that
\[
 \binom{n}{s}^{-1} \sim \sqrt{2\pi s} \rho^s (1-\rho)^{s(1-\rho)/\rho}.
\]

Using again that $s/n=\rho(1+O(1/n))$, and that $m=O(\eps n)=o(n)$, we have
\[
 p^{-m} = \frac{n^{(r-1)m}}{\la^m(r-2)!^m} \sim \frac{s^{(r-1)m}}{\la^m(r-2)!^m\rho^{(r-1)m}}.
\]
Next, we shall eliminate $\la$ from this expression. From \eqref{rdefc}, \eqref{Prdef2}
and \eqref{rhosdef} we have
\[
 \frac{(r-1)m}{s}= \frac{s+t-1}{s} = 1+\Psi_r(\rho) = 1+\frac{\rho^*_{r,\la}}{\rho} =
 \frac{\la}{r\rho}\bb{1-(1-\rho)^r}.
\]
Hence
\[
 \la^m = ((r-1)m/s)^m r^m \rho^m \bb{1-(1-\rho)^r}^{-m}.
\]

Putting the pieces together we obtain the asymptotic formula
\begin{eqnarray}
 C_r(s,t) &\sim& \frac{\sqrt{6}}{4\pi} \frac{r-1}{s} e^m
  \frac{s^{(r-1)m}}{\la^m (r-2)!^m \rho^{(r-1)m}}
\sqrt{2\pi s} \rho^s (1-\rho)^{s(1-\rho)/\rho} \nonumber \\
 &=& \frac{\sqrt{3}}{2\sqrt{\pi}} \frac{r-1}{\sqrt{s}} e^m
  \frac{s^{(r-1)m}}{\la^m (r-2)!^m \rho^{(r-1)m}}
 \rho^s (1-\rho)^{s(1-\rho)/\rho} \nonumber \\
 &=& \frac{\sqrt{3}}{2\sqrt{\pi}} \frac{r-1}{\sqrt{s}} e^m
  \frac{(1-(1-\rho)^r)^m s^{(r-1)m}}{((r-1)m/s)^m r^m \rho^m (r-2)!^m \rho^{(r-1)m}}
 \rho^s(1-\rho)^{s(1-\rho)/\rho} \nonumber \\
 &=& \frac{\sqrt{3}}{2\sqrt{\pi}} \frac{r-1}{\sqrt{s}} e^m
  \frac{(1-(1-\rho)^r)^m s^{rm}}{m^m r!^m \rho^{rm}}
 \rho^s (1-\rho)^{s(1-\rho)/\rho}, \label{Cr1}
\end{eqnarray}
proving the main formula \eqref{enumform} of Theorem~\ref{thenum}.

Turning to \eqref{Pform}, let
\[
 N=\binom{s}{r} = \frac{s(s-1)\cdots (s-r+1)}{r!} = \frac{s^r}{r!}e^{-\binom{r}{2}/s+O(s^{-2})}.
\]
Since $m\sim s/(r-1)$, it follows that
\[
 N^m \sim \frac{s^{rm}}{r!^m} e^{-\binom{r}{2}m/s} \sim \frac{s^{rm}}{r!^m} e^{-r/2}.
\]
Since $N=\Theta(s^r)$, for $r\ge 3$ we have $m^2=o(N)$, and it follows that
\[
 \binom{N}{m} = \frac{N(N-1)\cdots (N-m+1)}{m!} \sim \frac{N^m}{m!}.
\]
On the other hand, if $r=2$ then $m\sim s$ and $N\sim s^2/2$, so
\[
  \binom{N}{m} = \frac{N^m}{m!} e^{-\binom{m}{2}/N+o(1)} \sim e^{-1} \frac{N^m}{m!}.
\]
We may write the last two formulae together as $\binom{N}{m}\sim e^{-\ind{r=2}} N^m/m!$, where
$\ind{A}$ denotes the indicator function of $A$.
Hence, using Stirling's formula, and recalling that $m=(s+t-1)/(r-1) \sim s/(r-1)$,
\[
 \binom{N}{m} \sim \frac{e^{-r/2-\ind{r=2}}}{\sqrt{2\pi m}} \frac{e^ms^{rm}}{m^mr!^m}
 \sim \frac{e^{-r/2-\ind{r=2}}}{\sqrt{2\pi s/(r-1)}}  \frac{e^ms^{rm}}{m^mr!^m}
\]
From this and \eqref{Cr1} we obtain the expression
\begin{eqnarray*}
 P_r(s,t) &\sim&  e^{r/2+\ind{r=2}}\sqrt{2\pi s/(r-1)} \frac{\sqrt{3}}{2\sqrt{\pi}} \frac{r-1}{\sqrt{s}}
   \frac{(1-(1-\rho)^r)^m }{ \rho^{rm-s}}
 (1-\rho)^{s(1-\rho)/\rho} \\
 &=& e^{r/2+\ind{r=2}} \sqrt{\frac{3(r-1)}{2}}  \left(\frac{(1-(1-\rho)^r)}{\rho^r}\right)^m
  \left(\frac{(1-\rho)^{(1-\rho)/\rho}}{\rho}\right)^s,
\end{eqnarray*}
completing the proof.
\end{proof}

redpajama_set_name: RedPajamaArXiv