%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% AMSLaTeX file for the paper                                        %
%                                                                    %
% REGULAR PAIRS IN SPARSE RANDOM GRAPHS I                            %
%                                                                    %
% by Y. Kohayakawa and V. R\"odl                                     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Time-stamp: <Tuesday 31 Dec 2002 08:43:23pm BRST yoshi@erdos.ime.usp.br>   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[reqno]{amsart}

\usepackage{upref}
\usepackage{amssymb}
\usepackage[colorlinks,backref]{hyperref}
%\usepackage[backref]{hyperref}
%\usepackage{srcltx}

%From thmtest.tex, probably
\newtheoremstyle{note}% name
  {4pt}%      Space above
  {4pt}%      Space below
  {\sl}%      Body font
  {}%         Indent amount (empty = no indent, \parindent = para indent)
  {\itshape}% Thm head font
  {.}%        Punctuation after thm head
  {.5em}%     Space after thm head: " " = normal interword space;
        %       \newline = linebreak
  {}%         Thm head spec (can be left empty, meaning `normal')

\theoremstyle{plain}
\newtheorem{theorem}             {Theorem}       
\newtheorem{claim}     [theorem] {Claim}         
\newtheorem{lemma}     [theorem] {Lemma}         
\newtheorem{corollary} [theorem] {Corollary}     
\newtheorem{fact}      [theorem] {Fact}          
\newtheorem{conjecture}[theorem] {Conjecture}    
\newtheorem{problem}   [theorem] {Problem}       

\theoremstyle{note}
\newtheorem{remark}             {Remark}       
\newtheorem{example}   [remark] {Example}       
\newtheorem{note}      [remark] {Note}       
\newtheorem{definition}[remark] {Definition}       
\newtheorem{case}               {Case}       

%From thmtest.tex
\newtheoremstyle{introthms}% name
  {3pt}%      Space above, empty = `usual value'
  {3pt}%      Space below
  {\itshape}% Body font
  {}%         Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {.}%        Punctuation after thm head
  {.5em}%     Space after thm head: " " = normal interword space;
        %       \newline = linebreak
  {\thmnote{#3}}% Thm head spec

\theoremstyle{introthms}
\newtheorem*{varthm}{}% all text supplied in the note

\setcounter{tocdepth}{3}
\def\endassertion{\egroup\par\ifdim\lastskip<\smallskipamount
                \removelastskip\penalty-20\smallskip\fi}
\def\assertion#1{\smallbreak\noindent
  \textit{#1}\enspace\ignorespaces\bgroup\sl}
\def\endcasebody{\par\ifdim\lastskip<\smallskipamount
                \removelastskip\penalty-20\smallskip\fi}
\def\casebody{\noindent\ignorespaces}

%\def\ykcomm#1{{\rm[}\textsf{yk: #1$\,$}{\rm]}}
%\def\ykcomm#1{\marginpar{\small#1}}
\def\ykcomm#1{}
\def\WN{\hbox{\bf WHATNOT}}

\def\({\left(}
\def\){\right)}  
\let\:=\colon
\let\sim=\thicksim
\def\<{\langle}
\def\>{\rangle}
\let\epsilon=\varepsilon
\let\rho=\varrho
%\let\sigma=\varsigma

\def\Bi{\mathop{{\rm Bi}}\nolimits}
\def\PC{\mathop{\textsc{PC}}\nolimits}
\def\D{\mathop{\textsc{D}}\nolimits}
\def\ChUB{\mathop{\textsc{ChUB}}\nolimits}
\def\Ch{\mathop{{\rm Ch}}\nolimits}
\def\ECB{\mathop{\textsc{ECB}}\nolimits}
\def\AxECB{\mathop{\textsc{AxECB}}\nolimits}
\def\AxChUB{\mathop{\textsc{AxChUB}}\nolimits}
\def\AxPC{\mathop{\textsc{AxPC}}\nolimits}

\def\PCR{\mathop{\textsc{PCR}}\nolimits}
\def\LCR{\mathop{\textsc{LCR}}\nolimits}


\def\EE{\mathop{\hbox{\raise.03ex\hbox{${\mathbb E}$}}}\nolimits}
\def\PP{\mathop{\hbox{\raise.03ex\hbox{${\mathbb P}$}}}\nolimits}
%\def\PP{\mathop{\mathbb P}\nolimits}

\def\TT{{\mathbb T}}
\def\FF{{\mathbb F}}
\def\Cchub{C_\wedge}
\def\Cecb{C_{\rm ECB}}
\def\td{{\widetilde d}}
\def\tH{{\widetilde H}}
\def\tR{{\widetilde R}}
\def\tT{{\widetilde T}}
\def\tU{{\widetilde U}}
\def\tW{{\widetilde W}}
\def\bU{{\bar U}}
\def\bd{{\bar d}}

\def\cB{{\mathcal B}}
\def\tcB{\widetilde{\mathcal B}}
\def\cE{{\mathcal E}}
\def\cF{{\mathcal F}}
\def\cH{{\mathcal H}}
\def\cI{{\mathcal I}}
\def\cN{{\mathcal N}}
\def\cS{{\mathcal S}}
\def\betaexcept{\beta_{\rm exc}}
%\def\bbeta{{\mathbf\beta}}
\def\balpha{{\mathbf a}}
\def\bbeta{{\mathbf b}}
\def\bfd{{\mathbf d}}
\def\bfpi{{\boldsymbol\pi}}
\def\bfV{{\mathbf V}}

\def\br{{\bar r}}
\def\bs{{\bar s}}

\def\vB{{D}}

\def\e{{\rm e}}
\def\eG{e_G}
\def\dHp{d_{H,p}}
\def\dBp{d_{B,p}}
\def\dFp{d_{F,p}}
\def\dGp{d_{G,p}}

\def\sizeR{\mathop{r_{\rm e}}\nolimits}
\def\AxPC{\mathop{\textsc{AxPC}}\nolimits}

\hyphenation{quasi-ran-dom-ness}

\begin{document}

\title[Regular pairs in random graphs I]%
{Regular pairs in sparse random graphs I}
\author{Y.~Kohayakawa}
%\thanks{Partially supported by FAPESP (Proc.~96/4505--2) and by CNPq
%  (Proc.~300334/93--1 and ProTeM-CC-II Project ProComb).  Part of this work
%  was done while this author was visiting 
%  Humboldt-Universit\"at zu Berlin through PROBRAL project number~026/95, a
%  CAPES--DAAD exchange programme.}
\address{Instituto de Matem\'atica e Estat\'{\i}stica, Universidade de
  S\~ao Paulo, Rua do Mat\~ao 1010, 05508--090~S\~ao Paulo, Brazil} 
\email{yoshi@ime.usp.br}
\author{V.~R\"odl}
%\thanks{Research partially supported by NSF grant DMS--9401559.  Part
%  of this work was done while this author was visiting the
%  Humboldt-Universt\"at zu Berlin through a Humboldt Professorship.} 
\address{Department of Mathematics and Computer Science, Emory
  University, Atlanta, GA 30322, USA}
\email{rodl@mathcs.emory.edu}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\dedicatory{Dedicated to the memory of Professor Paul Erd\H os}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\thanks{The first author was partially supported by FAPESP
%  (Proc.~96/04505--2), by CNPq (Proc.~300334/93--1), and by MCT/CNPq under
%  PRONEX project 107/97.}
\thanks{The first author was partially supported by MCT/CNPq through ProNEx
  Programme (Proc.\ CNPq 664107/1997--4), by CNPq (Proc.~300334/93--1
  and~468516/2000--0), and by FAPESP (Proj.~96/04505--2).  The second author
  was partially supported by NSF Grant~0071261. The collaboration between
  the authors is supported by a CNPq/NSF cooperative grant.\\
  %
  \null\hspace{\parindent} The authors are grateful to the referee for his or
  her careful work and encouraging words.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subjclass{%Primary 05C55, % Generalised Ramsey theory
  05C80}                   % Random graphs 
%  Secondary: 05C35}       % Extremal problems
\keywords{Random graphs, regular pairs, Szemer\'edi's regularity
  lemma}
%\date{Working draft, not for circulation.  Copy produced on \today}
\date{Copy produced on \today}
%\date{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{abstract}
  We consider bipartite subgraphs of sparse random graphs that are
  regular in the sense of Szemer\'edi and, among other things, show
  that they must satisfy a certain local pseudorandom property.  This
  property and its consequences turn out to be useful when considering
  embedding problems in subgraphs of sparse random graphs.
\end{abstract}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\thispagestyle{empty}
\bgroup
\vspace{-1truecm}
\small
\tableofcontents
\egroup

\section{Introduction}
\label{sec:intro}
Many graph properties are shared by most graphs.  A more formal way of stating
this is to define a \textit{random graph}, that is, a probability distribution
over a suitable family of graphs, and then show that the probability of the
events of interest tend to one as the order of the random graph tends to
infinity.  Typical properties of random graphs are deterministically
equivalent in the sense that any large enough graph that satisfies one of
these properties must satisfy all others as well.  The equivalence of some of
these properties was first proved by Thomason~\cite{thomason87} and some other
authors~\cite{alon88:_explic,frankl88,rodl86}.  An important paper in this
area is due to Chung, Graham, and Wilson~\cite{chung89}, who systematized the
theory and very clearly advocated the importance of the equivalence of many
quite disparate quasirandom properties.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Graphs with such properties are called \textit{quasirandom}. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

One may argue that quasirandom graphs are fundamental by relating them to a
celebrated theorem of Szemer\'edi, namely, his beautiful regularity
lemma~\cite{szemeredi76}.  Indeed, the regularity lemma states that the edge
set of \textit{any} graph can be decomposed into quasirandom induced bipartite
subgraphs.  In this context, quasirandom bipartite graphs are called
\textit{$\epsilon$-regular pairs}.  A wealth of material concerning the
regularity lemma may be found in an excellent survey by Koml\'os and
Simonovits~\cite{KomlosSimonovits96}.

Owing to the work of many authors, we may now say that the notion of
quasirandomness applied to `dense' graphs is quite well understood.  Here, by
a \textit{dense graph} we mean a graph with~$\geq cn^2$ edges, where~$c$ is
any fixed positive constant, $n$~is the number of vertices in the graph, and
we consider~$n\to\infty$.  The situation is different for the case of `sparse'
graphs, namely, graphs with~$o(n^2)$ edges.  (See, however,
Remark~\ref{rem:chung-graham_recent} in
Section~\ref{sec:sparse_case_difficult} below.)  Our aim in this paper is to
investigate the structure of sparse $\epsilon$-regular pairs, with
applications to the theory of random graphs in mind.

In the remainder of the introduction, we discuss some of the theorems that we
prove in this paper, together with some other related facts.  In
Section~\ref{sec:dense_case}, to motivate our results, we recall two
well-known theorems concerning `dense' regular pairs.  In
Section~\ref{sec:sparse_case_difficult}, we present two \textit{negative}
results that show that straightforward extensions to the sparse case of the
two theorems in Section~\ref{sec:dense_case} do not hold.  In
Section~\ref{sec:positive_results}, we state two \textit{positive} results,
Theorems~A$''$ and Theorem~B$''$: these results concern subgraphs of sparse
random graphs and are our `sparse counterparts' to the two theorems in
Section~\ref{sec:dense_case}.  In this paper we focus on Theorem~A$''$ and
some related results.

We conclude this somewhat long introduction with a discussion on some
applications of Theorems~A$''$ and~B$''$, which will appear elsewhere.

% \subsection*{Acknowledgement}
% \label{sec:acknows}
% We are grateful to the referee for his or her careful work and encouraging
% words.

\subsection{An equivalence result for regularity and an embedding lemma}
\label{sec:dense_case}
In this section, we discuss two well-known results concerning
$\epsilon$-regular pairs.

Fix~$0<p<1$ and let~$m$ be an integer.  Let~$U$ and~$W$ be two disjoint sets
with $|U|=|W|=m$.  Consider the random bipartite graph~$G(m,m;p)$ on $U\cup
W$, in which the edges are chosen randomly and independently with
probability~$p$.

One can show that the following two properties are satisfied with probability
tending to~$1$ as $m\to\infty$.
\begin{enumerate}
\item[($P_1$)]{\sl $\sum_{u\in U}|\deg(u)-pm|=o(m^2)$ and
    $m^{-2}\sum_{u,\,u'\in U}|\deg(u,u')-p^2m|=o(m)$.  Here,
    $\deg(u)$~and~$\deg(u,u')$ denote the number of neighbours of~$u$
    {\rm(}the \textit{degree} of~$u${\rm)} and the number of common neighbours
    of~$u$ and~$u'$ {\rm(}the \textit{joint degree} or \textit{codegree}
    of~$u$ and~$u'${\rm)}, respectively.}
\item[($P_2$)]\label{ii}{\sl For every $U'\subset U$ and $W'\subset W$, the
    number $e(U',W')$ of edges $\{u,w\}\in G(m,m;p)$, with $u\in U'$ and $w\in
    W'$, satisfies $e(U',W')=p|U'||W'|+o(m^2)$.}
\end{enumerate}

It turns out that these properties (together with several others) are
equivalent in the following deterministic sense.

\begin{varthm}[Theorem~A (Equivalence lemma)]
%  \label{varthm:pair_condition}
  For every~$\epsilon>0$, there exist~$m_0$ and~$\delta>0$ such that any
  bipartite graph $G=(U,W;E)$ with $|U|=|W|=m>m_0$ that satisfies one of
  properties~$P_1$ or~$P_2$ with~$o(m^2)$ replaced by~$\leq\delta m^2$ must
  satisfy the other one with~$o(m^2)$ replaced by~$\leq\epsilon m^2$.
\end{varthm}

Theorem~A, either in full or in part, and its variants have appeared in
several papers, because of its
basic nature; see, for example, \cite{AlonDLRY92,%  
alon94,%
babai86:_compl,%
chung89,%
DukeLefmannRodlcount,%
frankl88,%
thomason87,%
thomason87:_random%,%
} and the upper bound in Theorem~15.2 in~\cite{erd74:_probab}.

The importance of Theorem~A comes from the fact that property~$P_2$ is in fact
fundamental, as the next result shows.  Let~$G=(V,E)$ be a graph and~$U$,
$W\subset V$ a pair of disjoint sets of vertices.  Denote by~$E(U,W)$ the set
of all edges between~$U$ and~$W$, \textit{i.e.},
$$
E(U,W)=\big\{\{u,w\}\:u\in U,\;w\in W\big\}.
$$
The density of the pair~$(U,W)$ is defined by
\begin{equation}
  \label{eq:reg:1_intro}
  d(U,W)=\frac{|E(U,W)|}{|U||W|}.
\end{equation}
The pair $(U,W)$ is called $\epsilon$-regular if
\begin{equation}
  \label{eq:reg:2_intro} 
  |d(U,W)-d(U',W')|<\epsilon 
\end{equation}
for any $U'\subset U$ and $W'\subset W$ with $|U'|\geq\epsilon|U|$ and
$|W'|\geq\epsilon|W|$.  We may now state Szemer\'edi's celebrated regularity
lemma.

\begin{theorem}[Szemer\'{e}di's regularity lemma~\cite{szemeredi76}]
  \label{thm:reg_intro}
  For every~$\epsilon>0$ and~$k_0\geq1$, there exists an
  integer~$K_0=K_0(\epsilon,k_0)$ such that any graph~$G$ admits a partition
  $V=V_1\cup\dots\cup V_k$, where $|V_1|\leq
  |V_2|\leq\dots\leq|V_k|\leq|V_1|+1$ and $k_0\leq k\leq K_0$, such that all
  but $\leq\epsilon{k\choose2}$ pairs~$(V_i,V_j)$ are $\epsilon$-regular.
\end{theorem}

In view of Theorem~\ref{thm:reg_intro}, we may say that bipartite graphs that
satisfy property~$P_2$ in Theorem~A are the building blocks for \textit{all
  graphs}.  This highlights the importance of property~$P_2$.

Note that Theorem~A, the equivalence lemma, tells us that the notion of
$\epsilon$-regularity is equivalent to a condition concerning global
uniformity of degrees and codegrees.  Since codegrees concern only pairs of
vertices, and not large subsets~$U'$ and~$W'$ as in the definition of
regularity, we have a `local' criterion for regularity.  

\begin{remark}[Pair condition for regularity]
  \label{rem:pair_condition}
  We refer to the implication {\rm``$P_2\Rightarrow P_1$''} as the \textsl{pair
    condition for regularity}, or~$\PCR$.
\end{remark}

\begin{remark}[Local condition for regularity]
  \label{rem:local_condition}
  We refer to the implication {\rm``$P_1\Rightarrow P_2$''} as the
  \textsl{local condition for regularity}, or~$\LCR$.
\end{remark}

Let us now consider applications of the regularity lemma.  The result below
and its generalizations are crucial in the proofs of most of the applications
of the regularity lemma.

\begin{varthm}[Theorem~B (Embedding lemma)]
% \label{obs:1_intro}
  For every $d>0$, there exist an~$\epsilon>0$ and $m_0\geq1$ such that the
  following holds: let~$H$ be a graph with vertex set $\{1,\dots,k\}$.
  Let~$G=(V,E)$ be a graph and $V_1,\dots,V_k$ be~$k$ disjoint subsets of~$V$,
  with~$|V_1|=\dots=|V_k|=m\geq m_0$.  If all pairs $(V_i,V_j)$ with
  $\{i,j\}\in E(H)$ are $\epsilon$-regular with density~$\geq d$, then~$G$
  contains a copy of~$H$ with vertex set $\{v_1,\dots, v_k\}$, with $v_i\in
  V_i$ for all $1\leq i\leq k$.
\end{varthm}

It is quite natural to refer to results of the form of Theorem~B as
\textit{embedding lemmas}.  It turns out that one can in fact prove that the
number of copies of the graph~$H$ in~$G$ in Theorem~B is at least
$d^{|E(H)|}m^k(1-g(\epsilon))$, where $g(\epsilon)\to0$ as $\epsilon\to0$.
Such statements are sometimes referred to as \textit{counting lemmas}.

\subsection{Negative results for the sparse case}
\label{sec:sparse_case_difficult}
Let us now discuss two negative results that show that the results in
Section~\ref{sec:dense_case} do not generalize to the sparse case.  In order
to deal with graphs with vanishing density, that is, $o(n^2)$~edges, we need
to redefine the concept of density.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Suppose we have a graph~$G=(V,E)$ on~$n$ vertices and edge
%density~$p=|E|/{n\choose2}$.   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Suppose we have a bipartite graph~$B=(V,E)$ with vertex partition~$V=U\cup W$.
Let~$T=|E|$ be the number of edges in~$B$.  We shall say that~$B$ is
\textit{$(\epsilon,T)$-regular} if for all~$U'\subset U$ and~$W'\subset W$
with~$|U'|\geq\epsilon|U|$ and~$|W'|\subset\epsilon|W|$, we have
\begin{equation}
  \label{eq:epsilon_T_regular_def}
  \left||E(U',W')|-{|U'||W'|\over|U||W|}T\right|
  \leq\epsilon{|U'||W'|\over|U||W|}T. 
\end{equation}
One's hope to extend Theorem~A, the equivalence lemma, to the `sparse' case in
a na\"\i ve way is dashed by the following result.

\begin{varthm}[Theorem~A$\boldsymbol{'}$ (Counterexample to~$\PCR$, sparse
  setting)] For every~$0<\alpha<1$ and~$0<\epsilon<1$, there exist a
  constant~$0<p<1$ and an integer~$m_0\geq1$ such that for every~$m>m_0$ there
  is a bipartite graph~$B$ with vertex classes~$U$ and~$W$ with~$|U|=|W|=m$
  and with~$T$ edges such that
  \begin{enumerate}
  \item[(\textit{i})]$B$~is $(\epsilon,T)$-regular, 
  \item[(\textit{ii})]$(1-\epsilon)pm^2\leq T\leq(1+\epsilon)pm^2$,
  \end{enumerate}
  but
  \begin{enumerate}
  \item[(\textit{iii})]for all but~$\leq\alpha m^2$ pairs~$u_1$, $u_2\in U$
    $(u_1\neq u_2)$, we have
    \begin{equation}
      \label{eq:counterexample_intro}
      \deg(u_1,u_2)=0
      \text{ and consequently }
      \big|\deg(u_1,u_2)-d^2m\big|>\epsilon d^2m,
    \end{equation}
    where~$d=T/m^2$ is the density of~$B$.
  \end{enumerate}
\end{varthm}

Recall that Theorem~A, the equivalence lemma, is composed of the `pair
condition for regularity'~($\PCR$) and the `local condition for
regularity'~($\LCR$).  Theorem~A$'$ above tells us that a straightforward
generalization of~$\PCR$ does not hold in the sparse setting.

Theorem~B, the embedding lemma, may not be extended to the sparse case in a
straightforward way either, as the following result shows.

\begin{varthm}[Theorem~B$\boldsymbol{'}$ (Counterexample to the embedding
  lemma, sparse setting)] For every~$0<\epsilon<1$, there exist a
  constant~$0<p<1$ and an integer~$m_0\geq1$ for which the following holds.
  For every~$m>m_0$, there is a tripartite graph~$J$ with vertex
  classes~$V_1$, $V_2$, and~$V_3$, all of cardinality~$m$, such that for
  all~$1\leq i<j\leq3$, the bipartite graph~$J_{ij}$ induced by~$V_i$
  and~$V_j$ is such that
  \begin{enumerate}
  \item[(\textit{i})]$J_{ij}$ has $T=\lfloor pm^2\rfloor$ edges, 
  \item[(\textit{ii})]$J_{ij}$ is $(\epsilon,T)$-regular,
  \end{enumerate}
  but
  \begin{enumerate}
  \item[(\textit{iii})]$J$ contains no triangle~$K^3$ as a subgraph.
  \end{enumerate}
\end{varthm}

\begin{remark}
  \label{rem:chung-graham_recent}
  In a recent paper, Chung and Graham~\cite{chung01:_spars} address thoroughly
  the problem of extending to the sparse case the well-known notion of
  quasirandomness of graphs, as developed in Chung, Graham, and
  Wilson~\cite{chung89}.  In particular, Chung and
  Graham~\cite{chung01:_spars} investigate the problem of extending embedding
  lemmas to the sparse setting.  
  
  We remark that Thomason~\cite{thomason87,thomason87:_random} did prove
  embedding lemmas for sparse graphs, starting from natural, but stronger,
  pseudorandom hypotheses.  Although we do not make this precise, we mention
  that the approach taken in~\cite{chung01:_spars} is different from the
  approach taken earlier by Thomason, in that the authors
  of~~\cite{chung01:_spars} tackle the problem of identifying what one can say
  if one starts from certain natural, weaker assumptions that are, in a some
  sense, more in line with~\cite{chung89}.
\end{remark}

Theorem~A$'$ is proved in Section~\ref{sec:counterexample} by means of a
probabilistic construction.  The basic underlying idea for the construction
proving Theorem~B$'$, which is similar in nature, was proposed by \L
uczak~\cite{luczak94}.

\subsection{Positive results for the sparse case}
\label{sec:positive_results}
Given the importance of Theorems~A and~B, it is desirable to seek
generalizations of these results to the `sparse' case.  Because of examples
such as the ones we saw in Section~\ref{sec:sparse_case_difficult}, such
generalizations will necessarily be somewhat complex; the straightforward
generalizations simply fail to be true.  In this section, we present two
results that allows one to circumvent the difficulties illustrated by the
examples in Section~\ref{sec:sparse_case_difficult}.  More precisely, we shall
discuss two results that state that the natural generalizations \textit{are
  true} if we restrict ourselves to graphs that arise as subgraphs of random
graphs.  We do not discuss the proofs of these results in this section; we
shall see later in this paper that a key idea in proving such results is to
show that \textit{the number of counterexamples such as the ones given in
  Section~\ref{sec:sparse_case_difficult} are extremely rare} (for a more
detailed discussion on this point, see Section~\ref{sec:philosophy}).

As we shall see later when we discuss their applications in
Section~\ref{sec:applications}, the results that we present here are
well-suited for approaching the issues discussed in
Section~\ref{sec:dense_case} in the context of subgraphs of random graphs.

We now state our first main result, which may be thought of as a `pair
condition for regularity'~($\PCR$); roughly speaking, this result shows that
the implication ``$P_2\Rightarrow P_1$'' is valid in the context of subgraphs
of random graphs.  As usual, we write~$G(n,p)$ for the standard binomial
random graph on~$n$ vertices and edge probability~$p$.

\begin{varthm}[Theorem~A$\boldsymbol{''}$ (Pair condition lemma, sparse
  setting)] For any~$0<\alpha\leq1$, $0<\gamma\leq1$, and~$0<\eta\leq1$, there
  exists a constant~$\epsilon>0$ for which the following holds.
  Let~$\omega=\omega(n)$ be a function with~$\omega\to\infty$ as~$n\to\infty$
  and let~$0<p=p(n)<1$ and~$m_0=m_0(n)$ be such that
  \begin{equation}
    \label{eq:p_lbd_intro}
    p^2m_0\geq(\log n)^4\omega.
  \end{equation}
  Then, with probability tending to~$1$ as~$n\to\infty$, we have
  that~$G=G(n,p)$ satisfies the following property.  Suppose~$B$ is any
  bipartite subgraph of~$G$, with vertex classes, say, $U$~and~$W$,
  with~$|U|$, $|W|\geq m_0$, and
  \begin{equation}
    \label{eq:T_lbd_intro}
    T\geq\alpha p|U||W|
  \end{equation}
  edges.  Suppose further that~$B$ is $(\epsilon,T)$-regular.  Then, for all
  but~$\leq\eta{|U|\choose2}$ pairs~$u_1$, $u_2\in U$~$(u_1\neq u_2)$, we have 
  \begin{equation}
    \label{eq:pc_upbd_intro}
    \big|\deg(u_1,u_2)-d^2|W|\big|\leq\gamma d^2|W|,
  \end{equation}
  where~$d=T/|U||W|$ is the density of~$B$.
\end{varthm}

To have a complete analogue of Theorem~A, the equivalence lemma, in the
context of subgraphs of random graphs, we need a `local condition for
regularity'~($\LCR$), that is, a result of the form ``$P_1\Rightarrow P_2$''
for this setting.  We do prove such a result later in this paper, but, owing
to its technical nature, we prefer to state it after we have developed some
notation (see Lemma~\ref{lem:mx_lemma} and Theorem~\ref{cor:mx_lemma_rgs} in
Section~\ref{sec:local_condition}).  Thus, we may claim that, at least in the
context of sparse graphs that arise as subgraphs of random graphs, there is a
full, natural generalization of the equivalence lemma, Theorem~A.  Most of
this paper is devoted to justifying this claim.

Let us turn to an embedding lemma in the context of subgraphs of random
graphs.  Let us introduce a piece of notation.  Let a real
number~$0<\epsilon\leq1$ and integers~$T\geq1$, $k\geq1$, and~$m$ be given.
We say that a graph~$F$ is an \textit{$(\epsilon,T,k+1,m)$-graph} if it
satisfies the following conditions:
\begin{enumerate}
\item[(\textit{i})]$F$ is $(k+1)$-partite, with all its vertex classes of
  cardinality~$m$,
\item[(\textit{ii})]all the~${k+1\choose2}$ naturally induced $m$~by~$m$
  bipartite subgraphs of~$F$ have~$T$ edges and are $(\epsilon,T)$-regular.
\end{enumerate}
We now give an embedding lemma for the complete graph~$K^{k+1}$ of
order~$k+1$.

\begin{varthm}[Theorem~B$\boldsymbol{''}$ (Embedding lemma, sparse setting)] 
  There is an absolute constant~$C>0$ for which the following holds.
  Let~$k\geq1$ and~$0<\alpha<1$ be given.  Then there exist~$\epsilon>0$
  and~$B>0$ for which the following holds.  Let
  \begin{equation}
    \label{eq:p_lbd_for_embedding_intro}
    p=Bn^{-1/k}(\log n)^C.
  \end{equation}
  Then, with probability tending to~$1$ as~$n\to\infty$, we have that if~$F$
  is an $(\epsilon,T,k+1,m)$-graph, where
  \begin{equation}
    \label{eq:T_positive_fraction_intro}
    T\geq\alpha pm^2,
    \quad
    m\geq{n\over\log n},
    \quad\text{and}\quad
    F\subset G=G(n,p),
  \end{equation}
  where~$F$ is not necessarily an induced subgraph of~$G$,
  then~$K^{k+1}\subset F$.
\end{varthm}

Theorem~B$''$ will be proved in a sequel to this paper.

\subsubsection{A generalization of Theorem~A$''$}
\label{sec:intro_k-tuple}
It turns out that a natural generalization of Theorem~A$''$, the pair
condition lemma in the sparse setting, is useful in certain applications.
Instead of considering pairs of vertices in a sparse regular pair, we may
consider $k$-tuples of vertices, for some fixed~$k$.  The question is, then,
whether most such $k$-tuples behave as though we were dealing with a genuine
random bipartite graphs, namely, whether most such $k$-tuples are such that
their joint neighbourhood has the expected cardinality.  We address this
question in this paper, and show that Theorem~A$''$ does indeed generalize to
arbitrary fixed~$k$ (see Theorem~\ref{cor:k-tuples_rgs}).  As we shall see in
Section~\ref{sec:applications}, such a generalization is useful in certain
graph embedding problems.

\subsubsection{The hereditary nature of $\epsilon$-regularity}
\label{sec:hereditary}
A fact that will play a crucial r\^ole in the proof of the generalization of
Theorem~A$''$ discussed above is that the property of being $\epsilon$-regular
has a strong \textit{hereditary nature}.  Indeed,
Section~\ref{sec:1-sided_nbhd_lemma} will be entirely devoted to proving a
family of results that illustrate this feature of $\epsilon$-regularity (we
refer to these results as the \textit{one-sided neighbourhood lemmas}).  Owing
to their technical nature, we do not discuss these results here.

In a sequel to this paper~\cite{kohayakawa00:_regul_ii}, we shall consider
\textit{two-sided} neighbourhood lemmas; these lemmas will be important in the
proof of Theorem~B$''$.  For completeness, we state a two-sided neighbourhood
lemma in Section~\ref{sec:2-sided-rgs}.  

\subsection{Applications}
\label{sec:applications}
Here, we discuss some applications of the results discussed so far.  In all of
the proofs of the applications that we mention below, the regularity lemma for
sparse graphs, given in Section~\ref{sec:regularity} below,
Theorem~\ref{thm:SSzp}, is used as the initial tool.  The results discussed in
Section~\ref{sec:positive_results} are then used to investigate the regular
pairs that we obtain from this application of Theorem~\ref{thm:SSzp}.

The results discussed in this section are proved elsewhere.  In this paper, we
concentrate on proving some of the basic lemmas discussed in
Section~\ref{sec:positive_results}.

\subsubsection{Random graphs and fault-tolerance}
\label{sec:fault-tolerance}
Theorem~\ref{cor:k-tuples_rgs} (see Section~\ref{sec:intro_k-tuple}) is one of
the tools used in the proof of a recent result concerning fault-tolerance
properties of random graphs, proved by Alon, Capalbo, Ruci\'nski, Szemer\'edi,
and the authors~\cite{alon00:_univer}.  In this section, we state and briefly
discuss this result.

We need some definitions and notation.  Let a real number~$0<\eta\leq1$
be fixed, and suppose~$G$ and~$H$ are graphs.  We write~$G\to_\eta H$ if any
subgraph~$J\subset G$ of~$G$ with size~$e(J)=|E(J)|\geq\eta e(G)$ contains
an isomorphic copy of~$H$ as a subgraph.  We extend this notation in the
following way.  Suppose that~$\cH$ is some family of graphs.  We write
\begin{equation}
  \label{eq:arrows_eta}
  G\to_\eta\cH
\end{equation}
if any subgraph~$J\subset G$ of~$G$ with size~$e(J)=|E(J)|\geq\eta e(G)$
contains an isomorphic copy of \textit{every} member~$H$ of~$\cH$.  In fact,
we say that a graph~$G$ is \textit{$\eta$-fault-tolerant} with respect to
a family of graphs~$\cH$ if~\eqref{eq:arrows_eta} holds.
%$\eta$-resilient?

In what follows, we shall be particularly interested in the
family~$\cB(\Delta;m,m)$ of $m$~by~$m$ bipartite graphs with maximum
degree~$\Delta$.  In fact, a result in~\cite{alon00:_univer} implies that
there are fairly small graphs that are $\eta$-fault-tolerant with respect
to~$\cB(\Delta;m,m)$ for any fixed~$\eta>0$.  Indeed, there exist such graphs
with~$n$ vertices and
\begin{equation}
  \label{eq:eta-ft_upbd}
  \leq C_1n^{2-{1/2\Delta}}(\log n)^{1/2\Delta}
\end{equation}
edges, where~$n\leq C_2m$, and $C_1=C_1(\eta,\Delta)$
and~$C_2=C_2(\eta,\Delta)$ are constants that depend only on~$\Delta$
and~$\eta$.  On the other hand, the following result follows from a simple
counting argument (see~\cite{alon00:_univer}): any graph~$G_0$ that is
\textit{universal} for the family~$\cB(\Delta;m,m)$, that is, any graph~$G_0$
that contains isomorphic copies of all members of~$\cB(\Delta;m,m)$, must
satisfy 
\begin{equation}
  \label{eq:universal_lbd}
  e(G_0)\geq C_3 m^{2-2/\Delta}
\end{equation}
for some absolute constant~$C_3>0$.  Note that the bound
in~\eqref{eq:universal_lbd} does not require the graph~$G_0$ to be
fault-tolerant.  In view of~\eqref{eq:universal_lbd}, we may argue that the
bound in~\eqref{eq:eta-ft_upbd} is quite satisfactory.  Let us turn to the
result in~\cite{alon00:_univer} that implies the bound
in~\eqref{eq:eta-ft_upbd}.

Let~$G(n,n;p)$ be the binomial bipartite random graph with both vertex classes
of cardinality~$n$ and with edge probability~$p$.  The following result is
proved in~\cite{alon00:_univer}.

\begin{theorem}
  \label{thm:ft}
  For any~$0<\eta\leq1$ and any~$\Delta\geq2$, there is a
  constant~$C=C(\eta,\Delta)>0$ for which the following holds.
  Suppose
  \begin{equation}
    \label{eq:p_lbd_ft}
    p=C\(\log n\over n\)^{1/2\Delta}
    \quad\text{and}\qquad
    m=\lfloor n/C\rfloor.
  \end{equation}
  Then, with probability tending~$1$ as~$n\to\infty$, the bipartite random
  graph~$G(n,n;p)$ satisfies
  \begin{equation}
    \label{eq:ft_relation}
    G(n,n;p)\to_\eta\cB(\Delta;m,m).
  \end{equation}
\end{theorem}

Besides making use of Theorem~\ref{cor:k-tuples_rgs}, the proof of
Theorem~\ref{thm:ft} uses a hypergraph packing result due to R\"odl,
Ruci\'nski, and Taraz~\cite{roedl99:_hyper}.

\subsubsection{Extremal problems for subgraphs of random graphs}
\label{sec:embedding_lemma}
The interplay between Ramsey theory and the theory of random graphs, beginning
with the seminal work of Erd\H os~\cite{erdoes47:_some}, has deeply influenced
both subjects.  More recently, several authors investigated threshold
functions for Ramsey properties (see, among others, \cite{%
frankl86,% Frankl--Rodl 
friedgut00:_sharp_ramsey,%
KKreuterCycles,%
luczak92:_ramsey,% Voigt
RodlRucinski93,%
rodl94,%
RodlRucinski95,%
spencer88:_three,%
spencer89:_errat%,%
}).  The investigation of threshold functions for Tur\'an type extremal
problems is also under way~\cite{HKLeven,HKLodd,KLRfour}, although a great
deal more remains to be done in this direction.  The fault-tolerance
properties of random graphs discussed in Section~\ref{sec:fault-tolerance} may
be thought of as the degenerate case of the Tur\'an type extremal problems we
discuss now in this Section.  (The readers interested in extremal and Ramsey
properties of random graphs are referred
to~\cite[Chapter~8]{janson00:_random_graph}.)  In this section, we discuss the
r\^ole of the results in Section~\ref{sec:positive_results} in this context.

It is not difficult to see that Theorem~B$''$, the embedding lemma in the
sparse setting, implies the following result.

\begin{theorem}
  \label{thm:K_k_Turan_rgs}
  There is an absolute constant~$C>0$ for which the following holds.
  Let~$k\geq1$ and~$\eta>0$ be given.  Then there exist~$B>0$
  such that if
  \begin{equation}
    \label{eq:p_lbd_for_embedding_intro_ft}
    p=Bn^{-1/k}(\log n)^C,
  \end{equation}
  then the random graph~$G(n,p)$ satisfies the relation
  \begin{equation}
  \label{eq:G(n,p)_Kk_ft}
    G(n,p)\to_{1-1/k+\eta}K^{k+1}
  \end{equation}
  with probability tending to~$1$ as~$n\to\infty$.
\end{theorem}

We now state a conjecture due to \L uczak and the authors~\cite{KLRfour} (see
also~\cite[Chapter~8]{janson00:_random_graph}) that says that, in fact, a
great deal more than Theorem~B$''$ should be true.

As before, let~$H=H^h$ be a graph of order~$h\geq3$ and suppose that~$H$ has
vertices~$v_1,\dots,v_h$.  We define the \textit{$2$-density} of~$H$ to be
\begin{equation}
  \label{eq:2-density_def}
  d_2(H)=\max\left\{{e(J)-1\over|V(J)|-2}\:J\subset H\text{,
  }|V(J)|\geq3\right\}. 
\end{equation}
Let~$\bfV=(V_i)_{i=1}^h$ be~$h$ pairwise disjoint sets, all of
cardinality~$m$.  We say that a graph~$F$ is an
\textit{$(\epsilon,T,H;\bfV)$-graph} if it satisfies the following conditions:
\begin{enumerate}
\item[(\textit{i})]$F$ has vertex set~$\bigcup_{1\leq i\leq h}V_i$, 
\item[(\textit{ii})]for every edge~$\{v_i,v_j\}\in E(H)$ of~$H$, the bipartite
  graph naturally induced by~$V_i$ and~$V_j$ in~$F$ has~$T$ edges and is
  $(\epsilon,T)$-regular.
\end{enumerate}
Let
\begin{equation}
  \label{eq:conj_thin_fam}
  \cF(\epsilon,T,H;\bfV)=\{F\:
  \text{$F$ is an $(\epsilon,T,H;\bfV)$-graph with~$H\not\subset F$}\}.
\end{equation}

If true, a far reaching generalization of Theorem~B$''$ would then be the
following.  

\begin{conjecture}
  \label{conj:thin_conjecture}
  For any~$\beta>0$, there exist constants~$\epsilon>0$ and~$C>0$ such that
  if 
  \begin{equation}
    \label{eq:T_lbd_conj}
    T\geq Cm^{2-1/d_2(H)},
  \end{equation}
  then, for all large enough~$m$, we have
  \begin{equation}
    \label{eq:thin_conjecture}
    |\cF(\epsilon,T,H;\bfV)|\leq\beta^{e(H)T}{m^2\choose T}^{e(H)}.
  \end{equation}
\end{conjecture}

%The fact that Conjecture~\ref{conj:thin_conjecture} does indeed strengthen
%Theorem~B$''$ may be seen from the discussion Section~\ref{sec:philosophy}.

If~$H$ above is a forest, Conjecture~\ref{conj:thin_conjecture} holds
trivially, since, in this case, the family in~\eqref{eq:thin_conjecture} is
empty for all large enough~$m$.  A lemma due to \L uczak and the
authors~\cite{KLRap3} may be used to show that
Conjecture~\ref{conj:thin_conjecture} holds for the case in which~$H=K^3$.

Some further remarks are in order.  The fact that the validity of
Conjecture~\ref{conj:thin_conjecture} would imply embedding lemmas such as the
one in Theorem~B$''$ comes from the considerations in
Section~\ref{sec:philosophy}.  In fact, one would have embedding lemmas for
general graphs~$H$ in dense and large enough $o(1)$-regular $h$-partite
subgraphs of~$G(n,p)$ even if~$p$ is as small as
\begin{equation}
  \label{eq:p_that_would_get}
  p=Cn^{-1/d_2(H)};
\end{equation}
we leave the details to the reader.  Note that, for the case in
which~$H=K^{k+1}$, relation~\eqref{eq:p_that_would_get}
gives~$p=Cn^{-2/(k+1)}$, which is better
than~\eqref{eq:p_lbd_for_embedding_intro_ft}.

\subsubsection{An application to Ramsey theory}
\label{sec:Ramsey}
Our aim in this section is to state a result in Ramsey theory whose proof
depends heavily upon, among others, the results in
Section~\ref{sec:positive_results}.  We need some definitions and notation.

Let an integer~$r\geq2$ be fixed, and suppose~$G$ and~$H$ are graphs.  We
write~$G\to(H)_r$ if~$G$ contains a monochromatic copy of~$H$ in any
edge-colouring of~$G$ with~$r$ colours.  In fact, for simplicity, we restrict
ourselves to the case in which we have only~$2$ colours, since for purposes of
this section there is not much difference between the~$r=2$ and~$r\geq3$
cases.

Following Erd\H os, Faudree, Rousseau, and Schelp~\cite{erdos78:_ramsey}, we
define the \textit{size-Ramsey number} of a graph~$H$ to be
\begin{equation}
  \label{eq:size_R_def}
  \sizeR(H)=\min\{e(G)\:G\to(H)_2\}.
\end{equation}
In words, the size-Ramsey number of a graph~$H$ is the minimal number of edges
that a graph~$G$ may have and still be `Ramsey for~$H$', that is, be such
that~$G\to(H)_2$.  For instance, $\sizeR(K(1,n))=2n-1$, where $K(1,n)$ denotes
the star with~$n$ edges.

In~\cite{Beck}, Beck answered a question of Erd\H os~\cite{erdos81:_i},
proving that there exists an absolute constant~$C\leq900$ such that
$\sizeR(P_n)<Cn$, where~$P_n$ denotes the path on~$n$ vertices.  Later,
in~\cite{BeckB}, Beck pointed out that there are trees with size Ramsey number
at least~$n^2/8$, and asked whether $\sizeR(H(n,\Delta))<C_\Delta n$ holds for
any $n$-vertex graph~$H(n,\Delta)$ with maximum degree~$\Delta$.  Beck's
question was answered affirmatively when~$H(n,\Delta)$ is a cycle~\cite{HKL}
or a tree~\cite{friedman87:_expan}.

Recently, R\"odl and Szemer\'edi~\cite{roedl00:_ramsey} proved that the answer
to Beck's question is negative already for~$\Delta=3$.  In fact, they showed
that there are positive constants~$c$ and~$\alpha$ so that, for every positive
integer~$n$, there are $n$-vertex graphs~$H$ with maximum degree~$\Delta(H)=3$
such that
\begin{equation}
  \label{eq:rodl_szemeredi_lbd}
  \sizeR(H)\geq cn(\log n)^\alpha.
\end{equation}

Set $\sizeR(n,\Delta)=\max\sizeR(H)$, where the maximum is taken over all
graphs~$H$ with~$n$ vertices and maximum degree~$\Delta$.  The results in
Section~\ref{sec:regular_pairs} are some of the tools that are used in the
proof of the following result, due to Szemer\'edi and the
authors~\cite{KohayakawaRSz99sizeRamsey}. 

\begin{theorem}
  \label{thm:size-Ramsey_upbd}
  For any integer~$\Delta\geq2$, there is a real
  number~$\epsilon=\epsilon(\Delta)>0$ for which we have
  \begin{equation}
    \label{eq:size-Ramsey_upbd}
    \sizeR(n,\Delta)\leq n^{2-\epsilon}.
  \end{equation}
\end{theorem}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{con}\label{con:3}
%For any $d \geq 3$ there exists $\epsilon_1 > 0$ and $\epsilon_2 > 0$ so that
%$$
%n^{1+\epsilon_1} \leq \hat{r}(n,d) \leq n^{2-\epsilon_2}.
%$$
%\end{con}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{The organization of this paper}
\label{sec:organization}
Let us now discuss the organization of this paper.  In
Section~\ref{sec:philosophy}, we present a basic idea that allows us to prove
results concerning large but arbitrary subgraphs of random graphs.  In a few
words, this idea consists of obtaining strong upper estimates for the the
number of counterexamples to the property we wish to prove for such subgraphs,
and then argue that such counterexamples do not occur in our random graph (see
Lemma~\ref{lem:Furedi}).  In Section~\ref{sec:prelims}, we introduce some
crucial definitions, we state a regularity lemma for sparse graphs, and also
prove a few technical results on random graphs that will be used later.  We
close this section with two tail inequalities.

In Section~\ref{sec:regular_pairs}, we state and prove the main results of
this paper.  Section~\ref{sec:pcl} is devoted to the statement and proof of
our pair condition lemma in the sparse context; in other words, we prove the
analogue of the implication ``$P_2\Rightarrow P_1$'' ($\PCR$) for this
context.  This result, which appears as Theorem~A$''$ above, is presented in
two versions; see Lemma~\ref{lem:pcl} (counting version) and
Theorem~\ref{cor:pcl} (random graphs version).
Section~\ref{sec:local_condition} is devoted to the statement and proof of our
local condition lemma in the sparse context; in other words, we prove the
analogue of the implication ``$P_1\Rightarrow P_2$'' ($\LCR$) for this
context.  Section~\ref{sec:1-sided_nbhd_lemma} is devoted to the statement and
proof of the one-sided neighbourhood lemmas.  These results are crucial in the
proof of the result discussed in Section~\ref{sec:intro_k-tuple} (see
Theorem~\ref{cor:k-tuples_rgs}).

In Section~\ref{sec:counterexample}, we prove Theorem~A$'$.

\begin{remark}
  \label{rem:result_types}
  The main results of this paper come in pairs.  Indeed, usually we prove a
  \textit{counting version} of our result and then we deduce a \textit{random
    graphs version}.  Typically, most of the work goes into proving the
  counting versions; the random graphs versions are often straightforward
  corollaries.  Nevertheless, we shall state the counting versions as `lemmas'
  and the random graphs versions are `theorems', since the random graphs
  versions tend to be somewhat less technical and the reader may find them
  easier to apply.
\end{remark}

\subsection{Remarks on notation}
\label{sec:notation}
Let us make the following comments on our notation explicitly.

\begin{remark}
  \label{rem:asymptotics1}
  If~$\epsilon>0$, we write~$a\sim_\epsilon b$ if
  \begin{equation}
    \label{eq:sim_def}
    1-\epsilon\leq{a\over b}\leq1+\epsilon.
  \end{equation}
  Note that the relation~$\sim_\epsilon$ \textit{is not symmetric}.  We also
  sometimes write~$a\asymp b$ if there exist absolute constants~$c$ and~$C>0$
  for which we have
  \begin{equation}
    \label{eq:asymp_def}
    cb\leq a\leq Cb.
  \end{equation}
  Sometimes we write an adorned variant of~$\asymp$, for example,
  $a\asymp_\vartheta b$, to mean that the constants~$c$ and~$C$ hidden in
  this~$\asymp$ notation may depend on this quantity~$\vartheta$.
\end{remark}

\begin{remark}
  Usually, we are concerned with graphs whose order
  {\rm(}typically~$n${\rm)} tends to infinity.  In the case of
  bipartite graphs, we shall have both vertex classes of large
  cardinality {\rm(}typically, the vertex classes have order~$m_1$
  and~$m_2${\rm)}.  Occasionally, we write~$a\sim b$ to mean that
  $a/b\to1$ as the order of the graph in question {\rm(}or both vertex
  classes of the bipartite graph in question{\rm)} tends to infinity.
  Similarly, we write~$a\ll b$ to mean that~$a/b\to0$.  We often omit
  the qualification `for large enough~$n$' or `for large enough~$m_1$
  and~$m_2$.'  This should not lead to confusion.
\end{remark}

\begin{remark}
  \label{rem:parameterized_constans}
  Several constants will appear in the lemmas that follow.  Often,
  when invoking a lemma, say Lemma~N, it may be important to record
  that a certain constant, say~$\epsilon$, with some particular value,
  is involved in the current application of Lemma~N.  In this case, we
  write~$\epsilon(N)$ for this particular value of this constant.  This
  fussy notation will guard us against the proliferation of constants
  with equal or similar names that will appear in what follows.
\end{remark}

\begin{remark}
  Our notation will basically follow~\cite{BBf}.  Since we are
  interested in asymptotic results, we shall often omit the floor and
  ceiling signs~$\lfloor\phantom x\rfloor$, $\lceil\phantom x\rceil$,
  when they are not important.
\end{remark}

\section{Excluding counterexamples}
\label{sec:philosophy}
There is a common underlying idea in the proofs that we present in this paper.
This idea may be stated in a few words as follows: suppose we wish to show
that,
\begin{enumerate}
\item[(*)]for almost all~$G=G(n,p)$, property~$S$ holds for every large enough
  subgraph~$H$ of~$G$,
\end{enumerate}
where~$S$ is some given `absolute' property of graphs (that is, given~$H$, we
may check whether or not~$H$ has~$S$ looking at~$H$ alone, disregarding~$G$).
In applications, `large enough' will mean that we have
\begin{equation}
  \label{eq:H_is_large_enough}
  m=|V(H)|\geq m_0=m_0(n)\text{\quad and\quad}T=e(H)=|E(H)|\geq\alpha
  p{m\choose2},  
\end{equation}
where~$m_0=m_0(n)$ is a reasonably fast growing function of~$n$ (say, some
small power of~$n$) and~$\alpha>0$ is a constant independent of~$n$.  Now,
observe that statements of the form~(*) involve a quantification over a very
large set of graphs~$H$.  Indeed, because of~\eqref{eq:H_is_large_enough}, we
have~$T=e(H)=\Omega(pm^2)$ and hence we are dealing with a quantity that is
more than exponential in~$\Omega(pm^2)$.  We point out that this is indeed a
large number in our context since the probability that~$G=G(n,p)$ is the empty
graph is already
$$
(1-p)^{n\choose2}\geq\exp\{-2pn^2\}
$$
if, say, $p\leq1/2$.

F\"uredi~\cite{Fu} observed that, in order to handle this difficulty, one may
proceed as follows.  First, we consider the family~$\cB=\cB(S)$ of
\textit{counterexamples} to assertion~$S$.  Then, we show that~$\cB$ is an
asymptotically small family (we make this precise later).  Finally, one then
simply shows that, almost surely, such rare graphs do not occur in~$G(n,p)$ as
subgraphs.  This idea has proved to be quite useful,
see~\cite{%
HKLeven,%
KKreuterCycles,%
KKS,%
KLRap3,%
KLRfour%
}.  (For an alternative approach, see~\cite{%
HKLodd,%
rodl94,%
RodlRucinski95,%
roedl97:_rado,%
roedl98:_ramsey%
}.)

It turns out that the easiest way to apply F\"uredi's idea is to show that the
size of the family of counterexamples~$\cB(S)$ grows `superexponentially more
slowly' than the size of the family of all graphs.  Let us make the following
definition.

\begin{definition}
  \label{def:thin}
  Let~$\cB$ be a family of labelled graphs and suppose~$\beta>0$ is a
  constant.  Write~$\cB(m,T)$ for the graphs in~$\cB$ that have~$m$ vertices
  and~$T$ edges.  For the sake of definiteness, suppose all graphs
  in~$\cB(m,T)$ have vertex set~$[m]=\{1,\dots,m\}$.  We shall say that~$\cB$
  is a \textit{$\beta$-thin} family if there exists an integer~$M$ such that,
  for all~$0\leq T\leq{m\choose2}$,
  \begin{equation}
    \label{eq:thin_def}
    \text{if~$m\geq M$, then }|\cB(m,T)|\leq\beta^T{{m\choose2}\choose T}.
  \end{equation}
\end{definition}

\begin{remark}
  \label{rem:bipartite_thin}
  We shall often consider families~$\cB$ of {\rm(}labelled{\rm)} bipartite
  graphs and in such cases we shall have independent parameters~$m_1$
  and~$m_2$ for the number of vertices in each of the vertex classes.  Such a
  family will be said to be $\beta$-thin if, instead of~\eqref{eq:thin_def},
  we have
  \begin{equation}
    \label{eq:thin_bip_def}
    \text{if~$m_1$, $m_2\geq M$, then
    }|\cB(m_1,m_2;T)|\leq\beta^T{m_1m_2\choose T},
  \end{equation}
  where~$\cB(m_1,m_2;T)$ is the set of graphs in~$\cB$ that have~$m_i$
  vertices in vertex class~$i$ $(i\in\{1,2\})$.  
\end{remark}

\begin{lemma}
  \label{lem:Furedi}
  Let functions $0<p=p(n)<1$ and~$m_0=m_0(n)$ such that
  \begin{equation}
    \label{eq:Furedi_p_m0_cond}
    pm_0\gg\log n
  \end{equation}
  be given, and consider the binomial random graph~$G=G(n,p)$.  Then,
  for any fixed constant~$\alpha>0$, there is a
  constant~$\beta=\beta(\alpha)>0$ such that the following assertion
  holds.  Suppose~$\cB$ is a $\beta$-thin family.  Then almost
  every~$G=G(n,p)$ has the property that no copy~$H$ of a member
  of~$\cB$ satisfying~\eqref{eq:H_is_large_enough} occurs as a
  subgraph of~$G$.
\end{lemma}
\begin{proof}
  Let~$\alpha>0$ be given.  We set
  \begin{equation}
    \label{eq:pf_Furedi_choice_beta}
    \beta=\beta(\alpha)={\alpha\over\e^3},
  \end{equation}
  and claim that this choice of~$\beta$ will do in our lemma.  The
  proof of this claim will be an easy application of the first moment
  method.  Let us estimate the expectation~$\EE(X)$ of the number of
  copies~$X=X_\cB$ of members of~$\cB$ in~$G=G(n,p)$ that
  satisfy~\eqref{eq:H_is_large_enough}.  For integers~$m$ and~$T$,
  let~$X(m,T)$ be the number of copies of elements of~$\cB(m,T)$
  in~$G$.  Then, assuming that~$m\geq M$, where~$M$ is as given in
  Definition~\ref{def:thin}, an application of~\eqref{eq:thin_def}
  gives that
  \begin{equation}
    \label{eq:pf_Furedi_EE_estimate}
    \EE(X(m,T))\leq(n)_m|\cB(m,T)|p^T
    \leq n^m\beta^T{{m\choose2}\choose T}p^T.
  \end{equation}
  We now observe that~\eqref{eq:H_is_large_enough} implies
  that~$T^{-1}p{m\choose2}\leq1/\alpha$.  Moreover,
  \eqref{eq:H_is_large_enough}~and~\eqref{eq:Furedi_p_m0_cond} give
  that~$m\geq m_0\gg\log n$ and that $T\geq\alpha p{m\choose2}\geq\alpha
  pm(m_0-1)/2\gg m\log n$.  Therefore, using~\eqref{eq:pf_Furedi_choice_beta},
  we may conclude~\eqref{eq:pf_Furedi_EE_estimate} with
  \begin{equation}
    \label{eq:pf_Furedi_EE_estimate2}
    \EE(X(m,T))\leq n^m\(\beta{\e p{m\choose2}\over T}\)^T
    \leq n^m\(\e\beta\over\alpha\)^T
    \leq\e^{m\log n-2T}\leq\e^{-T}.%\leq n^{-m}.
  \end{equation}
  We now sum~\eqref{eq:pf_Furedi_EE_estimate2} over all~$m$ and all~$T$
  satisfying~\eqref{eq:H_is_large_enough} to obtain that
  \begin{multline}
    \label{eq:pf_Furedi_EE}
    \EE(X)=\sum_{\vphantom{T\geq\alpha p{m\choose2}}m\geq m_0}\sum_{T\geq\alpha
    p{m\choose2}}\EE(X(m,T))
    =\sum_{\vphantom{T\geq\alpha p{m\choose2}}m\geq m_0}\sum_{T\geq\alpha
    p{m\choose2}}\e^{-T}\\ 
    \leq\sum_{m\geq m_0}2\e^{-\alpha p{m\choose2}}
    \leq2\sum_{m\geq m_0}n^{-m}=o(1),
  \end{multline}
  as~$n\to\infty$.  The lemma follows from~\eqref{eq:pf_Furedi_EE} and
  Markov's inequality.
\end{proof}

In what follows, we shall show that two families of graphs are $\beta$-thin:
see Remark~\ref{rem:beta-thinness_Lemma_8} just after Lemma~\ref{lem:pcl} and 
Remark~\ref{rem:1-sided-thin-remark} just after
Lemma~\ref{lem:1-sided_nbhd_lemma2}.  

\section{Preliminary results}
\label{sec:prelims}

\subsection{Preliminary definitions}
\label{sec:defs}

Let a graph~$G=G^n$ of order~$|V(G)|=n$ be fixed.  For~$U$, $W\subset V=V(G)$,
we write~$E(U,W)=E_G(U,W)$ for the set of edges of~$G$ that have one endvertex
in~$U$ and the other in~$W$.  We set~$e(U,W)=\eG(U,W)=|E(U,W)|$.

If~$B$ is a bipartite graph with vertex classes~$U$ and~$W$ and edge set~$E$
we write~$B=(U,W;E)$.  Moreover, if~$G$ is a graph and~$U$, $W\subset V(G)$
are disjoint sets of vertices, we write~$G[U,W]$ for the bipartite graph
naturally induced by~$U$ and~$W$.  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Now, let a
%partition~$P_0=(V_i)_1^\ell$ ($\ell\geq1$) of~$V$ be fixed.  For convenience,
%let us write~$(U,W)\prec P_0$ if~$U\cap W=\emptyset$ and either~$\ell=1$ or
%else~$\ell\geq2$ and for some~$i\neq j$ ($1\leq i,\,j\leq\ell$) we
%have~$U\subset V_i$, $W\subset V_j$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Here and in the
%sequel, we use standard definitions and notation concerning random graphs.
%Let~$0<p=p(n)\leq1$ be given.  The standard binomial random
%graph~$G_p=G_{n,p}$ has as vertex set a fixed set~$V(G_p)$ of cardinality~$n$
%and two such vertices are adjacent in~$G_p$ with probability~$p$, with all
%such adjacencies independent.  For concepts and results concerning random
%graphs, see, \textit{e.g.}, Bollob\'as~\cite{BBf}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{A regularity lemma for sparse graphs}
\label{sec:regularity}
Our aim in this section is to state a variant of the celebrated
regularity lemma of Szemer\'edi~\cite{szemeredi76}.

Let a graph~$H=H^n=(V,E)$ of order~$|V|=n$ be fixed.
Suppose~$\eta>0$, $C>1$, and~$0<p\leq1$.  We say that~$H$ is an
\textit{$(\eta,C)$-bounded} graph with respect to \textit{density}~$p$
if, for all~$U$, $W\subset V$ with~$U\cap W=\emptyset$ and~$|U|$,
$|W|\geq\eta n$, we have $e_H(U,W)\le Cp|U||W|$.  In what follows, for
any two disjoint non-empty sets~$U$, $W\subset V$, let
\begin{equation}
  \label{eq:p-density_def}
  \dHp(U,W)={e_H(U,W)\over p|U||W|}.
\end{equation}
We refer to~$\dHp(U,W)$ as the \textit{$p$-density} of the
pair~$(U,W)$ in~$H$.  When there is no danger of confusion, we
drop~$H$ from the subscript and write~$d_p(U,W)$.

Now suppose~$\epsilon>0$, $U$, $W\subset V$, and~$U\cap W=\emptyset$.
We say that the pair~$(U,W)$ is \textit{$(\epsilon,H,p)$-regular},
or simply \textit{$(\epsilon,p)$-regular}, if for all~$U'\subset
U$, $W'\subset W$ with~$|U'|\geq\epsilon|U|$ and~$|W'|\geq\epsilon|W|$
we have
$$
|\dHp(U',W')-\dHp(U,W)|\leq\epsilon.
$$
Below, we shall sometimes use the expression \textit{$\epsilon$-regular
  with respect to density~$p$} to mean that~$(U,W)$ is an
$(\epsilon,p)$-regular pair.  If~$B=(U,W;E)$ is a bipartite graph and~$(U,W)$
is an $(\epsilon,B,p)$-regular pair, we say that~$B$ is an
\textit{$(\epsilon,p)$-regular bipartite graph}.

We say that a partition~$Q=(C_i)_0^k$ of~$V=V(H)$ is
\textit{$(\epsilon,k)$-equitable} if~$|C_0|\leq\epsilon n$,
and~$|C_1|=\dots=|C_k|$.  Also, we say that~$C_0$ is the \textit{exceptional}
class of~$Q$.  When the value of~$\epsilon$ is not relevant, we refer to an
$(\epsilon,k)$-equitable partition as a \textit{$k$-equitable} partition.
Similarly, $Q$~is an \textit{equitable} partition of~$V$ if it is a
$k$-equitable partition for some~$k$.

We say that an $(\epsilon,k)$-equitable partition~$P=(C_i)_{0}^k$ of~$V$ is
\textit{$(\epsilon,H,p)$-regular}, or simply \textit{$(\epsilon,p)$-regular},
if at most~$\epsilon{k\choose2}$ pairs~$(C_i,C_j)$ with~$1\leq i<j\leq k$ are
not $(\epsilon,p)$-regular.  We may now state a version of Szemer\'edi's
regularity lemma for $(\eta,C)$-bounded graphs.

\begin{theorem}\label{thm:SSzp}
  For any given $\epsilon>0$, $C>1$, and $k_0\geq1$, there exist
  constants~$\eta=\eta(\epsilon,C,k_0)$
  and~$K_0=K_0(\epsilon,C,k_0)\geq k_0$ such that any graph~$H$ that
  is $(\eta,C)$-bounded with respect to density $0<p\leq1$ admits an
  $(\epsilon,H,p)$-regular $(\epsilon,k)$-equitable partition of its
  vertex set with $k_0\leq k\leq K_0$.\qed
\end{theorem}

Theorem~\ref{thm:SSzp} was independently observed by the present
authors, and in fact a simple modification of Szemer\'edi's proof of
his lemma gives this result.  For applications of this variant of the
regularity lemma, see~\cite{Kohayakawa97Szemeredi}.

\subsection{Further notation and definitions}
\label{sec:further}
We shall need some further notation and definitions concerning bipartite
graphs.  Throughout this section, we suppose we have a bipartite graph~$B$
with bipartition~$(U,W)$ with~$|U|=m_1$, $|W|=m_2$, and~$T=e(U,W)>0$.  We
let~$p=T/m_1m_2$, and~$d_1=pm_1$ and $d_2=pm_2$.  Note that the
$p$-density~$\dBp(U,W)$ of~$(U,W)$ in~$B$ is~$1$.

In what follows, we shall be concerned with pairs~$\{x,y\}$ of
vertices whose neighbourhoods intersect in an unexpected manner.  In
fact, for convenience, we introduce the following notation:
\begin{equation}
  \label{eq:F_gamma}
  F(U,W;\gamma)=F_B(U,W;\gamma)
    =\left\{\{x,y\}\in{U\choose2}\:\left|d_W(x,y)-{d_2^2\over
      m_2}\right|\geq\gamma{d_2^2\over m_2}\right\},
\end{equation}
where~$d_W(x,y)=d_W^B(x,y)=\big|W\cap\Gamma_B(x)\cap\Gamma_B(y)\big|
=\big|\Gamma_B(x)\cap\Gamma_B(y)\big|$.  The reader has most likely
already observed the following fact.  Suppose the bipartite graph~$B$
is drawn uniformly at random from all the $m_1\times m_2$ bipartite
graphs with~$T$ edges.  Then the expected value of~$d_W(x,y)$
with~$x\neq y\in U$ is~$d_2^2/m_2$. 

\begin{definition}[$\PC(U,W;\gamma,\eta)$]
  \label{def:PC_def}
  Let~$B=(U,W;E)$ be a bipartite graph.  We say that~$B$ has
  property~$\PC(U,W;\gamma,\eta)$ if
  \begin{equation}
    \label{eq:PC_condition}
    \big|F_B(U,W;\gamma)\big|\leq\eta{|U|\choose2}.
  \end{equation}
\end{definition}

The notation for the property~$\PC(U,W;\gamma,\eta)$ comes from the fact that
we are concerned with \textit{pairs of vertices}, and hence we have a certain
\textit{pair condition}.  For convenience, we
put~$\PC(U,W;\gamma)=\PC(U,W;\gamma,\gamma)$.  We shall also be interested in
a property concerning the `$\ell_1$-uniformity' of the \textit{degrees} of the
vertices in our bipartite graphs.

\begin{definition}[$\D(U,W;\delta,\epsilon)$]
  Let~$B=(U,W;E)$ be a bipartite graph.  We say that~$B$ has
  property~$\D(U,W;\delta,\epsilon)$ if
  \begin{equation}
    \label{eq:D(U,W,delta,epsilon)}
     \big|e(U',W)-p|U'||W|\big|\leq\delta p|U'||W|
      \text{ for all~$U'\subset U$ with~$|U'|\geq\epsilon|U|$.}
  \end{equation}
\end{definition}

Our next property on bipartite graphs is a certain one-sided inequality
concerning their edge distribution.  In fact, we are interested in a certain
\textit{edge concentration bound}.

\begin{definition}[$\ECB(U,W;C)$]
  Let~$B=(U,W;E)$ be a bipartite graph.  Put~$d=\min\{d_1,d_2\}$
  and~$m=\max\{m_1,m_2\}$.  We say that~$B$ has property~$\ECB(U,W;C)$ if the
  following holds: whenever $U'\subset U$ and~$W'\subset W$ are such
  that~$|U'|$, $|W'|\geq d/(\log m)^3$, we have
  \begin{equation}
    \label{eq:ECB}
    e(U',W')\leq Cp|U'||W'|.
  \end{equation}
\end{definition}

The final property for bipartite graphs that we consider in this
section is a little more technical.  This property concerns the number
of certain `cherries' (paths of length~$2$) in the bipartite graph in
question.  In fact, the idea is that such cherries should not, in
general, `concentrate' on any set of pairs of vertices too much (this
is made quantitatively precise through a certain \textit{cherry upper
  bound}).

\begin{definition}[$\ChUB(U,W;\delta,C)$]
  Let~$B=(U,W;E)$ be a bipartite graph.  We say that~$B$ has
  property~$\ChUB(U,W;\delta,C)$ if
  \begin{equation}
    \label{eq:ChUB}
    \sum_{\{x,y\}\in F}d_W(x,y)\leq C\delta p^2|U|^2|W|
     \text{ for all~$F\subset{U\choose2}$ with~$|F|\leq\delta{|U|\choose2}$},
  \end{equation}
  where, as before, $d_W(x,y)=\big|\Gamma_B(x)\cap\Gamma_B(y)\big|$.
\end{definition}

\subsection{Elementary lemmas on random graphs}
\label{sec:rgs_lemmas}
In this paragraph, we state and prove two simple lemmas concerning binomial
random graphs.

\subsubsection{The statement of the lemmas}
\label{sec:statement_of_elementary_lemmas}
We state the two lemmas in this section.  The proofs are given in
Section~\ref{sec:pfs_of_elementary_lemmas}. 

\begin{lemma}[Edge concentration bound for r.gs]
  \label{lem:ECB_rgs}
  Let~$\delta>0$ be a fixed constant.  Almost every random
  graph~$G=G(n,q)$ is such that the following property holds.
  Suppose~$m=m(n)$ is such that
  \begin{equation}
    \label{eq:degree_lbd}
    qm\gg\log n.
  \end{equation}
  Then, for any two disjoint sets of vertices~$U$, $W\subset V(G)$
  with~$|U|$, $|W|\geq m=m(n)$, we have
  \begin{equation}
    \label{eq:ECB_rgs_upbd}
    e(U,W)\sim_\delta q|U||W|.
  \end{equation}
\end{lemma}

\begin{lemma}[Cherry upper bound for r.gs]
  \label{lem:ChUB_rgs}
  Let~$\delta>0$ be a fixed constant. Almost every random
  graph~$G=G(n,q)$ is such that the following property holds.
  Suppose~$m=m(n)$ is such that
  \begin{equation}
    \label{eq:m_-lbd}
    q^2m\gg\log n.
  \end{equation}
  Then, for any two disjoint sets of vertices~$U$, $W\subset V(G)$
  with~$|U|$, $|W|\geq m=m(n)$, we have that for all
  \begin{equation}
    \label{eq:cond_on_F}
    F\subset{U\choose2}\text{\quad with\quad }|F|\leq\delta{|U|\choose2} 
  \end{equation}
  we have    
  \begin{equation}
    \label{eq:ChUB_rgs_upbd}
    \sum_{\{x,y\}\in F}d_W(x,y)\leq2\delta q^2|U|^2|W|,
  \end{equation}
  where~$d_W(x,y)=\big|W\cap\Gamma(x)\cap\Gamma(y)\big|$.
\end{lemma}

\begin{remark}
  It may be worth noting that condition~\eqref{eq:degree_lbd} may be
  thought of as meaning that the \textit{degree} of a vertex into the
  sets~$U$ and~$W$ should be large {\rm(}namely, superlogarithmic
  in~$n${\rm)}.  On the other hand, condition~\eqref{eq:m_-lbd}
  requires that the expected number of \textit{common neighbours} in
  the sets~$U$ and~$W$, of a fixed pair of vertices, should be
  superlogarithmic in~$n$.
\end{remark}

\subsubsection{Proofs of the elementary lemmas}
\label{sec:pfs_of_elementary_lemmas}
The proof of Lemma~\ref{lem:ECB_rgs} is immediate from Chernoff's
bound. 

\begin{proof}[Proof of Lemma~\ref{lem:ECB_rgs}]
  By a simple averaging argument, we see that it suffices to prove the
  assertion for sets~$U$ and~$W$ with~$|U|=|W|=m$.  The probability
  that~\eqref{eq:ECB_rgs_upbd} fails is clearly at
  most~$\exp\{-c_\delta q|U||W|\}=\exp\{-c_\delta qm^2\}$,
  where~$c_\delta>0$ is some constant that depends only on~$\delta>0$.
  The expected number of pairs~$(U,W)$ violating~\eqref{eq:ECB_rgs_upbd}
  is then
  \begin{equation}
    \label{eq:ECB_rgs_pf}
    \leq{n\choose m}^2\e^{-c_\delta qm^2}
    \leq\exp\{2m\log n-c_\delta qm^2\}=o(1),
  \end{equation}
  because of~\eqref{eq:degree_lbd}, and our lemma follows from
  Markov's inequality.
\end{proof}

The proof of Lemma~\ref{lem:ChUB_rgs} is a little more interesting.

\begin{proof}[Proof of Lemma~\ref{lem:ChUB_rgs}]
  Let a set of pairs~$F$ as in~\eqref{eq:cond_on_F} be given.  It is clear
  that we may assume that~$|F|=\delta{|U|\choose2}$.  Suppose that, however,
  inequality~\eqref{eq:ChUB_rgs_upbd} fails.  Let us first show that this
  implies the existence of a matching~$M\subset F$ on which too many
  cherries `concentrate.'
  
  For convenience, let us think of~$F$ as a graph on~$U$ and consider the line
  graph~$L(F)$ of~$F$.  Clearly, the maximum degree~$\Delta'(F)=\Delta(L(F))$
  of~$L(F)$ is at most~$2(\Delta(F)-1)<2|U|$.  Apply the Hajnal--Szemer\'edi
  theorem~\cite{hajnal70:_proof_p} to~$L(F)$ to obtain a decomposition of~$F$
  into~$\Delta'(F)+1$ matchings all of size
  \begin{equation}
    \label{eq:matching_size}
    \sim t=|F|/\Delta'(F).
  \end{equation}
  It will be important later that these matchings should be fairly large.
  Note that, since we are assuming that~$|F|=\delta{|U|\choose2}$, we have 
  \begin{equation}
    \label{eq:t_lbd}
    t={|F|\over\Delta'(F)}>{|F|\over2|U|}\sim{\delta\over4}|U|.
  \end{equation}
  We now let
  \begin{equation}
    \label{eq:k_0_def}
    k_0={2\over\Delta'(F)+1}\delta q^2|U|^2|W|,
  \end{equation}
  and observe that this is the right-hand side of~\eqref{eq:ChUB_rgs_upbd}
  divided by~$\Delta'(F)+1$, the number of matchings in our
  Hajnal--Szemer\'edi decomposition of~$F$.  Now, since we are assuming
  that~\eqref{eq:ChUB_rgs_upbd} fails, there must be a matching~$M\subset F$
  in this decomposition for which we have
  \begin{equation}
    \label{eq:new_lbd}
    \sum_{\{x,y\}\in M}d_W(x,y)>k_0.
  \end{equation}
  Let us now work on the right-hand side of~\eqref{eq:new_lbd}.  Since we are
  assuming that~$|F|=\delta{|U|\choose2}$, in view of~\eqref{eq:t_lbd}
  and~\eqref{eq:k_0_def}, we have
  \begin{equation}
    \label{eq:k_0_more}
    k_0\sim4{q^2|F|\over\Delta'(F)+1}|W|\sim4q^2t|W|.
  \end{equation}
  
  Therefore, the conclusion is that if~\eqref{eq:ChUB_rgs_upbd} fails, then
  there exists a matching~$M$ for which we have
  \begin{equation}
    \label{eq:|M|_asymp}
    |M|\gtrsim{\delta\over4}|U| 
  \end{equation}
  (recall~\eqref{eq:t_lbd} and that~$|M|\sim t$) and, moreover,
  \begin{equation}
    \label{eq:newnew_lbd}
    \sum_{\{x,y\}\in M}d_W(x,y)
    \gtrsim4q^2|W||M|. 
  \end{equation}
  Our aim now is to show that such a pair~$(W,M)$ almost surely does
  not occur in~$G=G(n,q)$.  To this end, observe that, since
  \begin{equation}
    \label{eq:sum_is_Bin}
    X=\sum_{\{x,y\}\in M}d_W(x,y)\sim\Bi(|W||M|,q^2),
  \end{equation}
  we have
  \begin{equation}
    \label{eq:X_dev_prob}
    \PP(X\geq k_0)\leq{|W||M|\choose k_0}q^{2k_0}
    \leq\({\e|W||M|\over k_0}q^2\)^{k_0}
    \leq\(\e\over3\)^{k_0}.  
  \end{equation}
  Therefore, the expected number of pairs~$(W,M)$ as above is
  \begin{multline}
    \label{eq:n_WM_upbd}
    \leq{n\choose|W|}n^{2|M|}\(\e\over 3\)^{3q^2|M||W|}
    \leq n^{|W|+2|M|}\(\e\over 3\)^{3q^2|M||W|}\\
    =\e^{(|W|+2|M|)\log n}\(\e\over 3\)^{3q^2|M||W|}.
  \end{multline}
  We now claim that the last term of~\eqref{eq:n_WM_upbd}
  is~$O(n^{-\omega})$ for some~$\omega\to\infty$ as~$n\to\infty$.
  To see this, consider the exponents in the last term
  of~\eqref{eq:n_WM_upbd}, and observe that
  \begin{equation}
    \label{eq:exponents_compared}
    q^2\gg\({1\over|M|}+{2\over|W|}\)\log n.
  \end{equation}
  To verify inequality~\eqref{eq:exponents_compared}, we
  use~\eqref{eq:m_-lbd}, \eqref{eq:|M|_asymp}, and the fact that~$|U|$,
  $|W|\geq m$, to see that
  \begin{equation}
    \label{eq:M_large}
    |M|q^2\gtrsim{\delta\over4}|U|q^2\geq{\delta\over4}mq^2\gg\log n, 
  \end{equation}
  and that
  \begin{equation}
    \label{eq:W_large}
    |W|q^2\geq mq^2\gg\log n.
  \end{equation}
  
  The proof is not quite finished, since we still have to consider all
  possible values for the cardinalities of~$W$ and~$M$.  However, summing over
  all possible choices for~$|W|$ and~$|M|$, we still have that the expected
  number of such pairs~$(W,M)$ is~$o(1)$.  The result follows from Markov's
  inequality.
\end{proof}

\subsection{Elementary tail inequalities}
\label{sec:auxiliary}
Let us state two simple technical lemmas that will be useful in
Section~\ref{sec:1-sided_nbhd_lemma}.  

\begin{lemma}[The hypergeometric tail lemma]
  \label{lem:hypergeometric}
  Let~$b$, $d$, $k$, and~$m$ be positive integers and suppose we
  select a $d$-set~$N$ uniformly at random from a set~$U$ of
  cardinality~$m$.  Suppose also that we are given a fixed
  $b$-set~$B\subset U$.  Then, writing~$k=\lambda bd/m$, we have
  \begin{equation}
    \label{eq:hypergeometric}
    \PP(|N\cap B|\geq k)
     =\sum_{j\geq k}{b\choose j}{m-b\choose d-j}{m\choose d}^{-1}
     \leq{d\choose k}\(b\over m\)^k\leq\(\e\over\lambda\)^k. 
  \end{equation}
\end{lemma}
\begin{proof}
  Without loss of generality, we suppose that~$U=[m]=\{1,\dots,m\}$
  and~$B=[b]$.  Let us estimate the number of sets~$N$ for
  which~$|N\cap B|\geq k$ in the following way.  First choose the
  smallest~$k$ elements of such a set~$N$.  Note that these elements
  must all be in~$B$.  Thus there are~${b\choose k}$ ways of making
  this choice.  Now choose the remaining~$d-k$ elements of~$N$; there
  are at most~${m-k\choose d-k}$ ways of doing this.  Therefore, we
  have that
  \begin{equation}
    \label{eq:hypergeometric2}
    \PP(|N\cap B|\geq k)
    \leq{b\choose k}{m-k\choose d-k}{m\choose d}^{-1}
    ={d\choose k}{(b)_k(m-k)_{d-k}\over(m)_d}.
  \end{equation}
  Now observe that~$(m)_d=(m)_k(m-k)_{d-k}$, and hence the right-hand
  side of~\eqref{eq:hypergeometric2} is in fact
  \begin{equation}
    \label{eq:hypergeometric3}
    {d\choose k}{(b)_k\over(m)_k}
    \leq{d\choose k}\(b\over m\)^k
    \leq\(\e db\over km\)^k.
  \end{equation}
  Since~$k=\lambda bd/m$, relation~\eqref{eq:hypergeometric} follows.
\end{proof}

Our second lemma concerns the number of edges that we typically capture when
we select a random $d$-set of vertices of a sparse graph.  Let us describe the
set-up we are concerned with.

Let a graph~$F=(U,E)$ with $|U|=m$ and~$|E|\leq\eta{m\choose2}$ be
given.  Suppose we select a $d$-set~$N$ uniformly at random from~$U$.
We are then interested in giving an upper bound for~$e(F[N])$, the
number of edges that the set~$N$ will induce in~$F$.

\begin{lemma}[The two-day lemma]
  \label{lem:2-day_lemma}
  For every~$\alpha$, $\beta>0$, there
  exist~$\eta_0=\eta_0(\alpha,\beta)>0$ such that,
  whenever~$0<\eta\leq\eta_0$, we have
  \begin{equation} 
    \label{eq:2-day_lemma}
    \PP\(e(F[N])\geq\alpha{d\choose2}\)\leq\beta^d.
  \end{equation}
\end{lemma}

\begin{remark}
  To avoid any possibility of confusion, we observe that an equivalent
  formulation of~\eqref{eq:2-day_lemma} is that 
  \begin{equation}
    \label{eq:2-day_lemma_b}
    \left|\left\{N\in{U\choose
    d}\:e(F[N])\geq\alpha{d\choose2}\right\}\right| 
    \leq\beta^d{m\choose d}.
  \end{equation}
\end{remark}

\begin{proof}[Proof of Lemma~\ref{lem:2-day_lemma}]
  We may assume that
  \begin{equation}
    \label{eq:d_upbd}
    d\leq m/100,
  \end{equation}
  say.  Indeed, if~$d>m/100$, it
  suffices to take~$\eta_0$ small enough so that
  \begin{equation}
    \label{eq:2DL_triv_case}
    \alpha{d\choose2}>\eta_0{m\choose2}.
  \end{equation}
  If~\eqref{eq:2DL_triv_case} holds, \textit{any} $d$-set~$N$ will be
  such that~$e(F[N])<\alpha{d\choose2}$.  Thus we assume
  that~\eqref{eq:d_upbd} holds.  Clearly, it suffices to prove the
  following variant of our lemma:
  \begin{enumerate}
  \item[(\dag)]for any~$0<\gamma\leq1/2$, there
    is~$\eta_0=\eta_0(\gamma)$ such that, for any~$0<\eta\leq\eta_0$,
    we have  
  \begin{equation} 
    \label{eq:2-day_lemma_gamma}
    \PP\(e(F[N])\geq\gamma{d\choose2}\)\leq2\gamma^d.
  \end{equation}
  \end{enumerate}
  We proceed to prove~(\dag).  Let
  \begin{equation}
    \label{eq:c_def}
    c={\gamma\over100\exp\{200\gamma^{-1}\log(1/\gamma)\}}
  \end{equation}
  and let~$\lambda$ be such that
  \begin{equation}
    \label{eq:lambda_def}
    \log\lambda=200\gamma^{-1}\log(1/\gamma).
  \end{equation}
  Observe that then
  \begin{equation}
    \label{eq:lambda_c}
    \lambda c=\gamma/100.
  \end{equation}
  Finally, we let~$\eta_0=\eta_0(\gamma)$ be defined by
  \begin{equation}
    \label{eq:eta_0_def}
    \eta_0={c\gamma^{1+10/\gamma}\over20\times4^{10/\gamma}}.
  \end{equation}
  We shall prove that this choice of~$\eta_0$ will do in~(\dag).
  Thus, suppose that we have~$0<\eta\leq\eta_0$.  We have to
  verify~\eqref{eq:2-day_lemma_gamma}.

  Let
  \begin{equation}
    \label{eq:B_def}
    B=\{x\in U\: d_F(x)\geq(\eta/c)(m-1)\},
  \end{equation}
  and observe that, then, we have
  \begin{equation}
    \label{eq:B_upbd}
    |B|\leq cm,
  \end{equation}
  since~$e(F)\leq\eta{m\choose2}$.  By the hypergeometric tail lemma
  (Lemma~\ref{lem:hypergeometric}), we see that
  \begin{multline}
    \label{eq:HTSL_applied}
      \PP(|N\cap B|\geq\lambda cd)\leq\(\e\over\lambda\)^{\lambda cd}
      \leq\exp\{(1-\log\lambda)\lambda cd\}\\
      \leq\exp\left\{-{1\over2}(\log\lambda)\lambda cd\right\}
      =\exp\left\{-d\log{1\over\gamma}\right\}=\gamma^d,
  \end{multline}
  where in the last inequality we used~\eqref{eq:lambda_def}
  and~\eqref{eq:lambda_c}.  We shall now consider the case in which 
  \begin{equation}
    \label{eq:2DL_conditional}
    |N\cap B|<\lambda cd={1\over100}\gamma d.
  \end{equation}
  Let us generate the vertices~$u_1,\dots,u_d$ of~$N$ sequentially, in
  this order, at random.  Let us assume
  that~\eqref{eq:2DL_conditional} holds; notice that there are at
  most~$2^d$ choices for the set~$I$ of indices $1\leq i\leq d$ for
  which~$u_i\in B$.  Let~$x_1,\dots,x_{d'}$ be the vertices~$u_i$
  with~$i\notin I$, where~$d'=|N\setminus B|\geq(1-\gamma/100)d$, and
  we think of them being chosen in this order.  In what follows, we
  shall argue that the choice of many of these vertices~$x_i$ is
  rather constrained, and we shall thus derive a strong bound for the
  probability of the event 
  \begin{equation}
    \label{eq:intersection_event}
    \big\{N\:|N\cap B|<\lambda cd\big\}
    \cap\left\{N\:e(F[N])\geq\gamma{d\choose2}\right\} 
  \end{equation}
  
  Now, from~\eqref{eq:2DL_conditional}, it follows that the number
  of edges in~$F[N]$ that touch vertices in~$B$ is at most~$\gamma
  d^2/100$.  If we induce~$\geq\gamma{d\choose2}$ edges in~$N$, we
  must have
  \begin{equation}
    \label{eq:edges_out_of_B}
    \geq\gamma{d\choose2}-{1\over100}\gamma d^2
    \geq{1\over2}\gamma{d\choose2}
  \end{equation}
  edges within~$F[N\setminus B]=F[x_1,\dots,x_{d'}]$.  Suppose that we
  have already chosen~$x_1,\dots,x_{i-1}$, and that we are about to
  choose~$x_i$.  Since all vertices~$x_j$ ($j<i$) are not in~$B$, we
  have that the number of edges incident to~$\{x_j\:j<i\}$ is less
  than~$(i-1)(\eta/c)(m-1)$.  We have to choose~$x_i$ from
  \begin{equation}
    \label{eq:remaining_vs}
    U_i=U\setminus(B\cup\{x_j\:j<i\}).
  \end{equation}
  Because of~\eqref{eq:d_upbd}, \eqref{eq:c_def},
  and~\eqref{eq:B_upbd}, we have that~$|U_i|\geq m/2$, with plenty to
  spare.  Hence the average degree into~$\{x_j\:j<i\}$ of a vertex
  in~$U_i$ is
  \begin{equation}
    \label{eq:degree_upbd}
    \leq\left.(i-1){\eta\over c}(m-1)\right/|U_i|
      \leq {i\eta\over c}m\left/{m\over2}\right.
      ={2i\eta\over c}.
  \end{equation}
  Since we are supposed to get $\geq(\gamma/2){d\choose2}$ edges
  within $N\setminus B=\{x_i\:1\leq i\leq d'\}$
  (cf.~\eqref{eq:edges_out_of_B}), we must have at least~$\gamma d/10$
  indices~$i$ for which we have
  \begin{equation}
    \label{eq:large_degree_vs}
    |\Gamma(x_i)\cap\{x_j\:j<i\}|\geq{\gamma\over10}i.
  \end{equation}
  Indeed, otherwise the number of edges in~$F[N\setminus B]$ would be
  at most
  $$
  {\gamma d\over10}\times d+d\times{\gamma d\over10}
  <{\gamma\over2}{d\choose2},
  $$
  which would contradict the bound in~\eqref{eq:edges_out_of_B}.
  Now, the bound on the average degree~\eqref{eq:degree_upbd} and
  Markov's inequality tells us that the probability
  that~\eqref{eq:large_degree_vs} happens for a given index~$i$ is 
  $$
  \leq{2i\eta/c\over i\gamma/10}={20\eta\over c\gamma}.
  $$
  
  Let us observe again that there are at most~$2^d$ choices for the set~$I$ of
  indices $1\leq i\leq d$ for which~$u_i\in B$.  Moreover, there are at
  most~$2^d$ choices for the set, say~$J$, of indices $1\leq i\leq d$ for
  which the choice of~$x_i$ results in a vertex for
  which~\eqref{eq:large_degree_vs} holds.
  
  Putting all of the above together, we see that the probability that the
  event in~\eqref{eq:intersection_event} happens is
  \begin{equation}
    \label{eq:event_prob_upbd}
    \leq2^d\times2^d\times\(20\eta\over c\gamma\)^{\gamma d/10}
    =\({20\times4^{10/\gamma}\over c\gamma}\eta\)^{\gamma d/10}.
  \end{equation}
  In~\eqref{eq:event_prob_upbd}, one of the~$2^d$ accounts for the number of
  choices for~$I$ and the other for the number of choices for~$J$.  Observe
  that the right-hand side of~\eqref{eq:event_prob_upbd} is at
  most~$\gamma^d$, because~$\eta\leq\eta_0$ and~$\eta_0$ is as given
  in~\eqref{eq:eta_0_def}.  We conclude that the probability of the event
  in~\eqref{eq:intersection_event} is at most~$\gamma^d$.  Combining this
  with~\eqref{eq:HTSL_applied}, we see that~(\dag) does hold.
\end{proof}

\section{Regular pairs in sparse random graphs}
\label{sec:regular_pairs}
The main results of this paper are given in this section.
Section~\ref{sec:pcl} is devoted to the statement and proof of our pair
condition lemma in the sparse context; see Theorem~A$''$ in
Section~\ref{sec:positive_results} and Lemma~\ref{lem:pcl} and
Theorem~\ref{cor:pcl} in Section~\ref{sec:pcl}.
Section~\ref{sec:local_condition} is devoted to the statement and proof of our
local condition lemma in the sparse context; see the discussion just after
Theorem~A$''$ in Section~\ref{sec:positive_results}.
Section~\ref{sec:1-sided_nbhd_lemma} is devoted to the statement and proof of
the one-sided neighbourhood lemmas; see the short discussion in
Section~\ref{sec:hereditary} concerning these results.

Finally, in Section~\ref{sec:k-tuples_rgs}, we state and prove the
generalization of Theorem~A$''$ briefly discussed in
Section~\ref{sec:intro_k-tuple}. 

\subsection{The pair condition lemma}
\label{sec:pcl}
We state and prove here a counting lemma (Lemma~\ref{lem:pcl}) concerning
sparse $\epsilon$-regular bipartite graphs that fail to satisfy a certain
local `pseudorandomness' condition.  In fact, we are interested in showing
that the overwhelming majority of $\epsilon$-regular bipartite
graphs~$B=(U,W;E)$ are such that property~$\PC(U,W;\gamma)$ holds, as long
as~$\epsilon\leq\epsilon_0(\gamma)$.  Our estimates will be strong enough to
imply that a.e.~random graph~$G=G(n,p)$ has the following property: any large
and dense enough bipartite subgraph~$B=(U,W;E)$ of~$G$ that is
$\epsilon$-regular does in fact satisfy~$\PC(U,W;\gamma)$, as long
as~$\epsilon\leq\epsilon_0(\gamma)$ (cf.~Theorem~\ref{cor:pcl}).

\begin{remark}
  \label{remark:deterministic_pcl}
  In the dense case, the $o(1)$-regularity of a bipartite graph $B=(U,W;E)$
  implies property $\PC(U,W;o(1))$.  Unfortunately, this may fail if
  $p=p_B(U,W)=e(B)/|U||W|\to0$ as $n\to\infty$ {\rm(}see
  Section~\ref{sec:counterexample}{\rm)}.  The results below,
  Lemma~\ref{lem:pcl} and Theorem~\ref{cor:pcl}, are alternative tools for
  handling the sparse case.
\end{remark}

\begin{remark}
  The proof of Lemma~\ref{lem:pcl} is similar in many aspects to the proof of
  Lemma~7 in Section~2.1 of~\cite{KLRfour}.
\end{remark}

\subsubsection{The statement of the lemma}
\label{sec:pcl_state}
We start by describing the set-up of interest.  We are concerned with
bipartite graphs~$B=(U,W;E)$ for which the following conditions and notation
apply:
\begin{enumerate}
\item[(\textit{i})]
  \begin{enumerate}
  \item[(\textit{a})]$|U|=m_1$, $|W|=m_2$, and $B$ has~$e(B)=T$ edges.
    Let~$p=T/m_1m_2$ and~$d_i=pm_i$ ($i\in\{1,2\}$).
    Set~$m=m_+=\max\{m_1,m_2\}$ and~$m_-=\min\{m_1,m_2\}$.
  \item[(\textit{b})]For some function~$\omega\to\infty$ as $m_1$,
    $m_2\to\infty$, we have  
  \begin{equation}
    \label{eq:T_lbd}
    T\geq\omega m_-^{1/2}m_+(\log m_+)(\log m_2)^{1/2}.
  \end{equation}
  \end{enumerate}
\item[(\textit{ii})] $B$ is $\epsilon$-regular with respect to
  density~$p$.
\item[(\textit{iii})] $B$ has property~$\ECB(U,W;C)$.
\item[(\textit{iv})] $B$ \textit{fails} to have property~$\PC(U,W;\gamma)$.
\end{enumerate}
Given~$U$, $W$, $\omega$, $\epsilon$, $\gamma$, and~$C$ as above, we
let
\begin{equation}
  \label{eq:Lemma_8_fam_def}
  \cB(U,W,\omega;\epsilon,\gamma,C)\;
  =\;\big\{B=(U,W;E)\:\text{(\textit{i})--(\textit{iv}) above hold}\big\}.
\end{equation}
In other words, $\cB=\cB(U,W,\omega;\epsilon,\gamma,C)$ is the family of
bipartite graphs~$B=(U,W;E)$ that satisfy (\textit{i})--(\textit{iv}) above;
note that the number of edges~$T$ of~$B$ is arbitrary, except that of course
we require that~\eqref{eq:T_lbd} should hold.  If~$T$ is a given integer, we
let
\begin{equation}
  \label{eq:Lemma_8_fam_def_T}
  \cB(U,W,\omega;\epsilon,\gamma,C;T)\;
  =\;\big\{B\in\cB(U,W,\omega;\epsilon,\gamma,C)\:
  \text{$B$ has~$T$ edges}\big\}.
\end{equation}

\begin{lemma}[The pair condition lemma, counting version]
  \label{lem:pcl}
  For all~$\beta>0$, $\gamma>0$, $C\geq1$, and~$\omega=\omega(m_1,m_2)$ such
  that $\omega(m_1,m_2)\to\infty$ as~$m_1$, $m_2\to\infty$, there exists
  an~$\epsilon>0$ such that, for any~$0\leq T\leq m_1m_2$, we have
  \begin{equation}
    \label{eq:pcl_upbd}
    \big|\cB(U,W,\omega;\epsilon,\gamma,C;T)\big|
    \leq\beta^T{m_1m_2\choose T}.
  \end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  the number of graphs satisfying
%  {\rm(\textit{i})}--{\rm(\textit{iv})} is
%  \begin{equation}
%    \label{eq:pcl_upbd}
%    \leq\beta^T{m_1m_2\choose T}.
%  \end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{lemma}

\begin{remark}
  \label{remark:T_condition}
  Let us observe that the condition on~$T$ in~{\rm(\textit{i})(\textit{b})} is
  equivalent to
  \begin{equation}
    \label{eq:T_joint_degree_condition}
    p^2m_-\geq\omega^2(\log m_+)^2\log m_2.
  \end{equation}
  Roughly speaking, inequality~\eqref{eq:T_joint_degree_condition} says that
  the expected size of the joint neighbourhood of two vertices in the same
  vertex class in~$B$ should be of reasonable size.
\end{remark}

\begin{remark}
  \label{rem:beta-thinness_Lemma_8}
  In the language of Section~\ref{sec:philosophy} {\rm(}see
  Definition~\ref{def:thin} and Remark~\ref{rem:bipartite_thin}{\rm)},
  Lemma~\ref{lem:pcl} tells us that 
  \begin{equation}
    \label{eq:fam_in_remark}
    \cB(U,W,\omega;\epsilon,\gamma,C)
  \end{equation}
  is a $\beta$-thin family as long as~$\epsilon$ is suitably small.  It will
  be important in applications that we may choose~$\beta$, $\gamma$, and~$C$
  as we please, and we still have a `good' choice for~$\epsilon$ to make the
  family in~\eqref{eq:fam_in_remark} a $\beta$-thin family.
  
  Finally, we observe that calculations analogous to the ones in the proof of
  Lemma~\ref{lem:Furedi} will show that, roughly speaking, random graphs
  almost surely do not contain `large' subgraphs isomorphic to the members of
  the family in~\eqref{eq:fam_in_remark}
  {\rm(}cf.~Theorem~\ref{cor:pcl}{\rm)}.   
\end{remark}

We now state the result concerning random graphs that may be deduced from
Lemma~\ref{lem:pcl}.

\begin{theorem}[The pair condition lemma, r.gs~version]
  \label{cor:pcl}
  Suppose~$0<q=q(n)<1$ and~$m_0=m_0(n)$ are such that
  \begin{equation}
    \label{eq:p_lbd}
    q^2m_0\gg(\log n)^4.
  \end{equation}
  Then, for all~$\alpha>0$ and~$\gamma>0$, there is~$\epsilon>0$ for which the
  following assertion holds.  Almost every~$G=G(n,q)$ is such that any
  $(\epsilon,q)$-regular bipartite subgraph $B=(U,W;E)\subset G$ of it,
  with~$|U|$, $|W|\geq m_0$ and~$|E|\geq\alpha e(G[U,W])$, satisfies
  property~$\PC(U,W;\gamma)$.
\end{theorem}

\subsubsection{Proof of the pair condition lemma}
\label{sec:pfofpcl}
We prove Lemma~\ref{lem:pcl} in this section.

To distinguish between the two r\^oles played by~$\gamma$ in
property~$\PC(U,W;\gamma)$ in condition~(\textit{iv}), we consider the
condition
\begin{enumerate}
\item[(\textit{iv$\,'$})]$B$ \textit{fails} to have
  property~$\PC(U,W;\gamma,\eta)$. 
\end{enumerate}

Clearly, to prove Lemma~\ref{lem:pcl}, it suffices to show the following
assertion: 
\begin{enumerate}
\item[(*)]\sl for all~$\beta>0$, $\gamma>0$, $\eta>0$, and~$C\geq1$,
  there exists an~$\epsilon>0$ such that the number of graphs
  satisfying {\rm(\textit{i})}--{\rm(\textit{iii})}
  and~{\rm(\textit{iv$\,'$})} satisfies~{\rm(\ref{eq:pcl_upbd})}.
\end{enumerate}

In fact, we shall show that~(*) follows from a claim we state below (see
Claim~\ref{claim:half_pcl}).  The proof of this claim will be, however,
somewhat lengthy.  Let us now give an outline of the proof of~(*), since this
should help motivate the statement of Claim~\ref{claim:half_pcl}.

\begin{proof}[Sketch of the proof of~{\rm(*)}]
  Let~$\cB$ be the set of all graphs satisfying (\textit{i})--(\textit{iii})
  and~(\textit{iv$\,'$}), where~$U$ and~$W$ are fixed.  Let now~$B\in\cB$ be
  fixed.  Since~$\PC(U,W;\gamma,\eta)$ does not hold, \textit{i.e.},
  inequality~\eqref{eq:PC_condition} fails, there is a partition~$U=U_1\cup
  U_2$ of~$U$ with~$\gtrsim\eta m_1^2/4$ elements of~$F_B(U,W;\gamma)$ `going
  across' the $U_1$--$U_2$ partition.  Moreover, we may assume
  that~$|U_1|=\lfloor m_1/2\rfloor$.  Let us fix such a partition of~$U$ and
  let us consider the bipartite graph~$F_\gamma=(U_1,U_2;F)$ naturally induced
  by~$F_B(U,W;\gamma)$.  Now put
  \begin{equation}
    \label{eq:(*)_S}
    S=S(B)=\left\{u\in U_2\:d^{F_\gamma}(u)\geq{\eta\over5}m_1\right\},
  \end{equation}
  where~$d^{F_\gamma}(u)$ denotes the degree of~$u$ in the bipartite
  graph~$F_\gamma$.  Note that
  \begin{equation}
    \label{eq:S_lbd}
    |S|\geq{\eta\over5}m_1.
  \end{equation}
  Indeed, otherwise we would have
  \begin{equation}
    \label{eq:(*)_contra}
    e(F_\gamma)
    \leq{\eta\over5}m_1\times\left\lceil{m_1\over2}\right\rceil
    +\left\lfloor{m_1\over2}\right\rfloor\times{\eta\over5}m_1
    <{1\over4}\eta m_1^2,
  \end{equation}
  which would be a contradiction to the choice of the
  partition~$U=U_1\cup U_2$.  Let~$B_1=(U_1,W;E_1)$ be the subgraph
  of~$B$ induced by~$(U_1,W)$ and note that then, because of the
  $(\epsilon,p)$-regularity of~$B$ (see~(\textit{ii})), we have
  $$
  T_1=e(B_1)\sim_\epsilon {T\over2}.
  $$
  
  We have shown that to any~$B\in\cB$ we may associate a
  pair~$\Lambda=\Lambda(B)=(B_1,S)$ with~$B_1$ and~$S$ as above.  Fix one
  such~$\Lambda(B)$ for each~$B\in\cB$ in an arbitrary fashion, and consider
  the naturally induced partition
  \begin{equation}
    \label{eq:cB_partition}
    \cB=\bigcup_\Lambda\cB_\Lambda.
  \end{equation}
  To prove that~$|\cB|$ is bounded by~(\ref{eq:pcl_upbd}), we shall estimate
  each~$|\cB_\Lambda|$ separately and then we shall sum over all possible
  pairs~$\Lambda=(B_1,S)$.  We leave the details for later.
\end{proof}

Claim~\ref{claim:half_pcl} will be used to estimate~$|\cB_\Lambda|$, where the
notation is as~(\ref{eq:cB_partition}).  Before we proceed, we need to
introduce the set-up that interests us in this claim.

Throughout this section, we keep the notation as defined in
conditions~(\textit{i})--(\textit{iii}) given before the statement of
Lemma~\ref{lem:pcl}.  We shall now be interested in bipartite
graphs~$B_1=(U_1,W;E_1)$, where~$U_1\subset U$, and sets~$N\subset W$
with~$|N|\sim_\epsilon d_2$ for which the following conditions, definitions,
and notation apply:
\begin{enumerate}
\item[(\textit{i})] $|U_1|=\lfloor m_1/2\rfloor$
  and~$e(B_1)=T_1\sim_\epsilon T/2$.  Moreover, $N\subset W$ is a
  subset of~$W$ of cardinality $|N|=d_2'\sim_\epsilon d_2$.
\item[(\textit{ii})]For all~$U'\subset U_1$ and~$W'\subset W$
  with~$|U'|\geq\epsilon m_1$ and~$|W'|\geq\epsilon m_2$, we have
  \begin{equation}
    \label{eq:B1_regularity}
    |d_{B_1,p}(U',W')-1|\leq\epsilon,
  \end{equation}
  where~$p=T/|U||W|$.  Recall
  that~$d_{B_1,p}(U',W')=e_{B_1}(U',W')/p|U'||W'|$ is the $p$-density
  of the pair~$(U',W')$ in~$B_1$
  (cf.~Section~\ref{sec:regularity}).
\item[(\textit{iii})]For all~$U'\subset U_1$ and~$W'\subset W$ with~$|U'|$
  and~$|W'|\geq d/(\log m)^3$, we have
  \begin{equation}
    \label{eq:B1_ECB}
    e_{B_1}(U',W')\leq Cp|U'||W'|.
  \end{equation}
  Here, $d=\min\{d_1,d_2\}$ and~$m=m_+=\max\{m_1,m_2\}$.  Note
  that~$d=T/m$. 
\item[(\textit{iv})]
  \begin{enumerate}
  \item[(\textit{a})]Consider
    \begin{equation}
      \label{eq:claim_iii}
      \vB=\left\{y\in U_1\:
          \left||\Gamma(y)\cap N|-{d_2'd_2\over m_2}\right|
          >\gamma{d_2'd_2\over m_2}
        \right\},
    \end{equation}
    and observe that~$\vB$ is the set of vertices~$y\in U_1$ whose
    neighbourhood sets~$\Gamma(y)\subset W$ do not intersect~$N$ in the
    expected way (recall that~$|N|=d_2'$; see~(\textit{i}) above).  Indeed,
    $y\in D$ if and only if~$|\Gamma(y)\cap N|$ presents a significant
    \textit{deviation} from the `expectation'~$d_2'd_2/m_2$.  Moreover,
    consider the partition~$\vB=\vB^-\cup\vB^+$ with~$y\in\vB^-$ if
    $|\Gamma(y)\cap N|<(1-\gamma){d_2'd_2/m_2}$ and~$y\in\vB^+$ if
    $|\Gamma(y)\cap N|>(1+\gamma){d_2'd_2/m_2}$.
  \item[(\textit{b})]$|\vB|\geq(\eta/5)m_1$.
  \end{enumerate}
\end{enumerate}
\begin{remark}
  \label{remark:intuitively}
  Intuitively, we may think of~$N$ above as the neighbourhood set of a
  vertex~$x$ in~$U_2$ in some graph~$B\in\cB_\Lambda$ with~$\Lambda=(B_1,S)$
  and~$x\in S$.
\end{remark}

We are now ready to state our claim.

\begin{claim}
  \label{claim:half_pcl}
  For all~$\beta_1>0$, $\eta>0$, $\gamma>0$, and~$C\geq1$, there
  is~$\epsilon>0$ such that, for any fixed graph~$B_1$ as above, the number of
  $d_2'$-sets~$N$ for which {\rm(\textit{i})}--{\rm(\textit{iv})} are
  satisfied is
  \begin{equation}
    \label{eq:claim:half_pcl}
    \leq\beta_1^{d_2'}{m_2\choose d_2'}.
  \end{equation}
\end{claim}

Before we prove Claim~\ref{claim:half_pcl}, we deduce~(*) assuming this
claim. 

\begin{proof}[Proof of {\rm(*)}]
  Let~$\beta$, $\gamma$, $\eta$, and~$C$ as in~(*) be given.  Let us define
  positive constants~$\beta_1$, $\beta_2$, and~$\beta_3$ by setting
  \begin{equation}
    \label{eq:*_constants_beta}
    \beta_3=\beta^2,
    \qquad\beta_2=\beta_3^2,
    \quad\text{and}\quad\beta_1=\beta_2^{10/\eta}.
  \end{equation}
  We wish to apply Claim~\ref{claim:half_pcl}.
  Let~$\beta_1(\ref{claim:half_pcl})=\beta_1$ (here we are using the
  convention in Remark~\ref{rem:parameterized_constans}).  We now let
  \begin{equation}
    \label{eq:*_constants_gamma}    
    \eta(\ref{claim:half_pcl})=\eta,
    \qquad\gamma(\ref{claim:half_pcl})=\gamma,
    \quad\text{and}\quad C(\ref{claim:half_pcl})=C.
  \end{equation}
  Claim~\ref{claim:half_pcl} applied to
  constants~$\beta_1(\ref{claim:half_pcl})$, $\eta(\ref{claim:half_pcl})$,
  $\gamma(\ref{claim:half_pcl})$, and~$C(\ref{claim:half_pcl})$ gives us a
  constant~$\epsilon(\ref{claim:half_pcl})>0$.  We now let
  \begin{equation}
    \label{eq:*_constants_epsilon}
    \epsilon
    =\min\left\{\epsilon(\ref{claim:half_pcl}),{1\over60}\eta\right\}. 
  \end{equation}
  We claim that this choice of~$\epsilon$ will do in~(*), and proceed to prove
  this claim.
  
  Let us consider the decomposition $\cB=\bigcup\cB_\Lambda$ given
  in~(\ref{eq:cB_partition}).  Fix~$\Lambda=(B_1,S)$.  For
  each~$B\in\cB_\Lambda$, we have a naturally associated bipartite
  graph~$B_2=(U_2,W;E_2)$ such that~$B=B_1\cup B_2$.  Let~$T_2=e(B_2)=T-T_1$.
  Moreover, put~$m_1'=\lfloor m_1/2\rfloor$ and~$m_1''=\lceil m_1/2\rceil$.
  Suppose~$U_2=\{u_1,\dots,u_{m_1''}\}$, and consider the degree
  sequence~$\bfd=\bfd(B_2)=(f_i)_{1\leq i\leq m_1''}$,
  where~$f_i=d_{B_2}(u_i)$ holds for all~$1\leq i\leq m_1''$.
  Since~$B\in\cB_\Lambda\subset\cB$ is $(\epsilon,p)$-regular, we know that
  $f_i\sim_\epsilon d_2$ for all but~$\leq2\epsilon m_1$ indices~$1\leq i\leq
  m_1''$.

  Let
  \begin{equation}
    \label{eq:S'_def}
    S'=\{u\in S\:d_{B_2}(u)\sim_\epsilon d_2\}.
  \end{equation}
  Since~$\epsilon\leq\eta/60$ (see~\eqref{eq:*_constants_epsilon}), we have,
  from~\eqref{eq:S_lbd}, that
  \begin{equation}
    \label{eq:S'_lbd}
    |S'|\geq\({\eta\over5}-2\epsilon\)m_1\geq{\eta\over6}m_1.
  \end{equation}
  Let
  \begin{equation}
    \label{eq:degree_decomposition}
    \cB_\Lambda=\bigcup_{\bfd}\cB_{\Lambda,\bfd}
  \end{equation}
  be the partition of~$\cB_\Lambda$ induced by the degree
  sequences~$\bfd=\bfd(B_2)=(f_i)_{1\leq i\leq m_1''}$.  Let us write
  $\sum_i^{S'}$ for the sum over all~$1\leq i\leq m_1''$ such that~$u_i\in
  S'$.  We then have, by Claim~\ref{claim:half_pcl}, 
  \begin{multline}
    \label{eq:degree_sequence_upbd}
    |\cB_{\Lambda,\bfd}|
    \leq\prod\left\{\beta_1^{f_i}{m_2\choose f_i}\:u_i\in S'\right\}
    \prod\left\{{m_2\choose f_i}\:u_i\notin S'\right\}\\
    =\prod_{1\leq i\leq m_1''}{m_2\choose f_i}
    \prod\left\{\beta_1^{f_i}\:u_i\in S'\right\}
    \leq{m_1''m_2\choose T_2}\beta_1^{\sum_i^{S'}f_i}.
  \end{multline}
  From~\eqref{eq:S'_def} and~\eqref{eq:S'_lbd}, we have
  \begin{equation*}
    \sum\nolimits_i^{S'}f_i
    \geq(1-\epsilon)d_2|S'|
    \geq(1-\epsilon){\eta\over6}m_1d_2
    \geq{\eta\over10}T,
  \end{equation*}
  where in the last inequality we used that~$\epsilon\leq\eta/60\leq1/60<2/5$.
  Therefore, by~\eqref{eq:*_constants_beta}, the right-hand side
  of~\eqref{eq:degree_sequence_upbd} is 
  \begin{equation}
    \label{eq:neu_label}
    \leq{m_1''m_2\choose T_2}\beta_2^T.
  \end{equation}
  We now wish to sum~\eqref{eq:neu_label} over all possible~$\bfd=(f_i)_{1\leq
    i\leq m_1''}$ to obtain an estimate for~$|\cB_\Lambda|$.  To estimate this
  sum, we use that
  \begin{equation}
    \label{eq:additional_estimate}
    (T_2+1)^{m_1''-1}\beta_2^{T/2}
    \leq(T+1)^{m_1}\beta_2^{T/2}\leq1,
  \end{equation}
  which follows from~\eqref{eq:T_lbd}, since that lower bound for~$T$ implies
  that~$T\geq\omega m_+\log m_+\geq\omega m_1\log m_1$.  We thus
  estimate~$|\cB_\Lambda|$ as follows, making use
  of~\eqref{eq:degree_decomposition}--\eqref{eq:additional_estimate}
  and~\eqref{eq:*_constants_beta}: 
  \begin{multline}
    \label{eq:cB_Lambda_upbd}
    |\cB_\Lambda|=\sum_{\bfd}|\cB_{\Lambda,\bfd}|
    \leq{T_2+m_1''-1\choose m_1''-1}{m_1''m_2\choose T_2}\beta_2^T\\
    \leq(T_2+1)^{m_1''-1}{m_1''m_2\choose T_2}\beta_2^T
    \leq(T+1)^{m_1}{m_1''m_2\choose T_2}\beta_2^T\\
    \leq{m_1''m_2\choose T_2}\beta_2^{T/2}
    ={m_1''m_2\choose T_2}\beta_3^T.
  \end{multline}
  Observe that, again by the lower bound on~$T$ in~\eqref{eq:T_lbd}, we have
  \begin{equation}
    \label{eq:another_beta_beats_whatever}
    2^{m_1+m_1''}\beta_3^{T/2}\leq1.
  \end{equation}
  We now sum~\eqref{eq:cB_Lambda_upbd} over all possible~$\Lambda=(B_1,S)$ and
  use~\eqref{eq:another_beta_beats_whatever} to obtain
  \begin{multline}
    \label{eq:cB_upbd_final}
    |\cB|=\sum_{T_1\sim_\epsilon
      T/2}\sum\big\{|\cB_\Lambda|\:\Lambda\text{ such that
      }e(B_1)=T_1\big\}\\ 
    \leq\sum_{T_1\sim_\epsilon T/2}2^{m_1}{m_1'm_2\choose
      T_1}2^{m_1''}
    {m_1''m_2\choose T_2}\beta_3^T
    \leq\beta_3^{T/2}\sum_{T_1}{m_1'm_2\choose T_1}{m_1''m_2\choose T_2}\\
    =\beta^T\sum_{T_1}{m_1'm_2\choose T_1}{m_1''m_2\choose T_2}
    =\beta^T{m_1m_2\choose T}.
  \end{multline}
  Inequality~\eqref{eq:cB_upbd_final} completes the proof
  of~\eqref{eq:pcl_upbd}, assuming Claim~\ref{claim:half_pcl}.
\end{proof}

To complete the proof of Lemma~\ref{lem:pcl}, it remains to prove
Claim~\ref{claim:half_pcl}.  

\begin{proof}[Proof of Claim~\ref{claim:half_pcl}]
  Let constants~$\beta_1$, $\eta$, $\gamma$, and~$C$ as in the statement of
  the claim be given.  Let~$\epsilon_0>0$ be such that
  \begin{equation}
    \label{eq:requirement_for_epsilon}
    2\(6\e C\epsilon_0\over\gamma\)^{\gamma/3C}\leq{1\over2}\beta_1.
  \end{equation}
  We now put
  \begin{equation}
    \label{eq:epsilon_claim10_def}
    \epsilon=\min\left\{{1\over40}\eta,{1\over6}\gamma,\epsilon_0\right\}, 
  \end{equation}
  and assert that this choice for~$\epsilon$ will do in
  Claim~\ref{claim:half_pcl}.  To verify this assertion, we count the~$N$ in
  question by considering two cases, according to the sizes of~$\vB^+$
  and~$\vB^-$.
  
  We start with the case in which~$|\vB^+|$ is large.

  \assertion{Case 1.}$|\vB^+|\geq(\eta/10)m_1$
  \endassertion
  %
  \casebody Our aim is to show that the number of sets~$N$ as in the statement
  of the claim that fall in this case is
  \begin{equation}
    \label{eq:claim_case1}
    \leq{1\over2}\beta_1^{d_2'}{m_2\choose d_2'}.
  \end{equation}
  We start by establishing the following assertion.
  \begin{enumerate}
  \item[(\dag)]\sl There is a set~$Y\subset\vB^+$ such that
    \begin{enumerate}
    \item[(\textit{i})]$d(y)\sim_\epsilon d_2=pm_2$ for all~$y\in Y$,
    \item[(\textit{ii})]$|\Gamma(w)\cap Y|\sim_{2\epsilon}p|Y|$ for at least
      $(1-2\epsilon)m_2$ vertices~$w\in W$,
    \item[(\textit{iii})]$|Y|\sim(\eta/20)(d/(\log m)^2)$.  
    \end{enumerate}
  \end{enumerate}
  \begin{proof}[Proof of~{\rm(\dag)}]
    Let~$U^*\subset U_1$ be the set of vertices~$u$ in~$U_1$ that have
    degree~$d(u)$ satisfying $|d(u)-d_2|>\epsilon d_2$.  Note
    that~$|U^*|<2\epsilon m_1$, since~(\textit{ii}) holds.  Clearly,
    \begin{equation}
      \label{eq:D+-U*_large}
      |\vB^+\setminus U^*|\geq\({\eta\over10}-2\epsilon\)m_1
      \geq{1\over20}\eta m_1,
    \end{equation}
    since~$\epsilon\leq\eta/40$ (cf.~\eqref{eq:epsilon_claim10_def}).  Fix an
    arbitrary subset~$\vB'\subset\vB^+\setminus U^*$ with
    \begin{equation}
      \label{eq:D'_lower_bd}
      |\vB'|={1\over20}\eta m_1.
    \end{equation}
    We select for~$Y$ a random subset of~$\vB'$ by putting every element of
    $\vB'$ in~$Y$ independently with probability
    \begin{equation}
      \label{eq:dag_prob}
      \PP(y\in Y)={d\over m_1(\log m)^2}.
    \end{equation}
    Then we have
    \begin{equation}
      \label{eq:|Y|_exp}
      \EE(|Y|)={\eta\over20}m_1\times{d\over m_1(\log m)^2}
      ={\eta d\over20(\log m)^2}.
    \end{equation}
    For~$w\in W$ and~$X\subset U_1$, put~$d_X(w)=|\Gamma(w)\cap X|$.
    Note that~$d_{\vB'}(w)\sim_\epsilon p|\vB'|$ for at
    least~$(1-2\epsilon)m_2$ vertices~$w\in W$, because~(\textit{ii})
    holds.  For any such~$w$, we have
    \begin{equation}
      \label{eq:dY(w)_exp}
      \EE(d_Y(w))
      \sim_\epsilon p{\eta\over20}m_1\times{d\over m_1(\log m)^2}
      =p\EE(|Y|).
    \end{equation}
    Note that, because of~\eqref{eq:T_lbd} and~\eqref{eq:|Y|_exp}, we
    have 
    \begin{equation}
      \label{eq:pEE|Y|_lbd}
      p\EE(|Y|)
      ={\eta\over20}\times{T\over m_1m_2}\times{T/m\over(\log m)^2}
      \gg\log m_2.
    \end{equation}
    Therefore, standard estimates for the binomial distribution tell us that a
    set~$Y$ as required exists.
  \end{proof}

  \begin{remark}
    \label{remark:Y_depends_N}
    Note that we have found a set~$Y$ as in~{\rm(\dag)} given a set~$N$ as in
    the statement of Claim~\ref{claim:half_pcl} that, furthermore, satisfies
    the hypothesis of Case~1.  In particular, $Y=Y(N)$~depends on~$N$.
  \end{remark}

  \begin{remark}
    \label{remark:number_of_Y}
    To estimate the number of sets~$N$ for which Case~1 applies, we shall
    estimate the number of such~$N$ with a given fixed~$Y=Y(N)$.  To complete
    the estimation, it suffices to sum over all possible~$Y$.  Note that,
    because of~{\rm(\dag)(\textit{iii})} and~\eqref{eq:T_lbd}, the number of
    such~$Y$ is
    \begin{multline}
      \label{eq:no_Y_upbd}
      \leq{m_1\choose d/(\log m)^2}
      \leq\({\e m_1\over d}(\log m)^2\)^{d/(\log m)^2}
      =\({\e m_1m\over T}(\log m)^2\)^{d/(\log m)^2}\\
      \leq\(m_1\log m\)^{d/(\log m)^2}
      \leq\exp\{2d/\log m\}
      \leq(1+o(1))^{d_2},
    \end{multline}
    which is a negligible factor {\rm(cf.~\eqref{eq:claim_case1})}.
  \end{remark}

  We fix a set~$Y$ as in~(\dag) and proceed with the proof of Case~1.
  Let~$W'\subset W$ be the subset of~$W$ of the `exceptional' vertices,
  namely, 
  \begin{equation}
    \label{eq:W_prime}
    W'=\{w\in W\:|\Gamma(w)\cap Y|\sim_{2\epsilon}\bd_Y\text{ fails}\},
  \end{equation}
  where
  \begin{equation}
    \label{eq:bd_Y}
    \bd_Y=p|Y|\sim{d_1\over m_1}\times{\eta d\over20(\log m)^2}
         ={\eta dd_1\over20m_1(\log m)^2}.
  \end{equation}
  
  Because of~(\dag)(\textit{ii}), we know that
  \begin{equation}
    \label{eq:W'_upbd}
    |W'|\leq2\epsilon m_2.
  \end{equation}
  Our aim now is to show that, because of the existence of the
  set~$Y$, the set~$N$ has to intersect~$W'$ in an unexpectedly
  substantial manner.  Our simple inequality for the tail of the
  hypergeometric distribution, Lemma~\ref{lem:hypergeometric}, will
  then finish the proof of this case.
  
  Let us count the number of edges between~$Y$ and~$N$.  On the one hand,
  since~$Y\subset\vB^+$, we have
  \begin{equation}
    \label{eq:1_edge_count}
    e(N,Y)=\sum_{y\in Y}|\Gamma(y)\cap N|
    \geq(1+\gamma)\sum_{y\in Y}{d_2'd_2\over m_2}
    =(1+\gamma)|Y|{d_2'd_2\over m_2}.
  \end{equation}
  Since~(\dag)(\textit{iii}) holds, we conclude that 
  \begin{equation}
    \label{eq:1_1/2_edge_count}
    e(N,Y)\gtrsim(1+\gamma){\eta dd_2'd_2\over20m_2(\log m)^2}.
  \end{equation}
  On the other hand, we have
  \begin{multline}
    \label{eq:2_edge_count}
    e(N,Y)=\sum_{w\in N}|\Gamma(w)\cap Y|
    =\sum_{w\in N\setminus W'}|\Gamma(w)\cap Y|
    +\sum_{w\in N\cap W'}|\Gamma(w)\cap Y|\\
    \leq|N\setminus W'|(1+2\epsilon)\bd_Y+e(N\cap W',Y)\\
    \leq(1+2\epsilon)d_2'{\eta dd_1\over20m_1(\log m)^2}
    +e(N\cap W',Y).
  \end{multline}
  Comparing~(\ref{eq:1_1/2_edge_count}) and~(\ref{eq:2_edge_count}) and using
  that $p=d_1/m_1=d_2/m_2$ and that~$\epsilon\leq\gamma/6$
  (cf.~\eqref{eq:epsilon_claim10_def}), we obtain that
  \begin{equation}
    \label{eq:edge_lb}
    e(N\cap W',Y)
    \geq{\gamma\over2}\times{\eta pdd_2'\over20(\log m)^2}.
  \end{equation}
  We now apply~(\textit{iii}).  Put~$|N\cap W'|=\alpha d_2'$.  Suppose first
  that~$|N\cap W'|=\alpha d_2'<d/(\log m)^3$.  Then, in fact, we extend the
  set~$N\cap W'$ to a larger set~$Z\subset W$ with~$|Z|=d/(\log m)^3$
  arbitrarily, so that we may indeed apply inequality~\eqref{eq:B1_ECB}
  in~(\textit{iii}).  We obtain that
  \begin{equation}
    \label{eq:e(|NcapW'|,Y)_upbd}
    e(N\cap W',Y)\leq e(Z,Y)\leq Cp|Z||Y|=Cp|Y|\times{d\over(\log m)^3}.
  \end{equation}
  However, we shall see that~\eqref{eq:e(|NcapW'|,Y)_upbd} leads to a
  contradiction.  Indeed, comparing~\eqref{eq:edge_lb}
  and~\eqref{eq:e(|NcapW'|,Y)_upbd}, and using~(\dag)(\textit{iii}), we obtain
  that
  \begin{multline}
    \label{eq:clashing_bds}
    {\gamma\over2}\times{\eta pdd_2'\over20(\log m)^2}
    \leq e(N\cap W',Y)\\
    \leq Cp|Y|{d\over(\log m)^3}
    \sim Cp\times{\eta d\over20(\log m)^2}\times{d\over(\log m)^3},
  \end{multline}
  which implies that
  \begin{equation}
    \label{eq:clashing_bds2}
    {1\over2}\gamma d_2'\lesssim {Cd\over(\log m)^3}.
  \end{equation}
  However, inequality~\eqref{eq:clashing_bds2} cannot hold for large~$m$,
  since~$d=\min\{d_1,d_2\}$ and~$d_2'\sim_\epsilon d_2$.  This contradiction
  shows that
  \begin{equation}
    \label{eq:|NcapW'|_lbd}
    |N\cap W'|=\alpha d_2'\geq{d\over(\log m)^3}.
  \end{equation}
  Inequality~\eqref{eq:|NcapW'|_lbd} tells us that~(\textit{iii}) applies
  immediately to give that
  \begin{equation}
    \label{eq:edge_ub}
    e(N\cap W',Y)\leq Cp|Y|\times\alpha d_2'.
  \end{equation}
  Putting~(\dag)(\textit{iii}), (\ref{eq:edge_lb}) and~(\ref{eq:edge_ub})
  together, we deduce that
  \begin{equation}
    \label{eq:clashing_bds3}
    {\gamma\over2}\times{\eta pdd_2'\over20(\log m)^2}
    \leq e(N\cap W',Y)
    \leq C\alpha p|Y|d_2'
    \sim C\alpha p{\eta dd_2'\over20(\log m)^2},
  \end{equation}
  which gives that~$\gamma/2\lesssim C\alpha$, and hence, say, 
  \begin{equation}
    \label{eq:alpha_lb}
    \alpha\geq{\gamma\over3C}.
  \end{equation}
  We now describe briefly how the proof will proceed.  Note that, because
  of~\eqref{eq:W'_upbd}, the expected cardinality~$\EE(|N\cap W'|)$ of~$N\cap
  W'$ is at most~$2\epsilon d_2'$.  Therefore, as~$\epsilon$ is chosen a great
  deal smaller than~$\gamma/C$, because of~\eqref{eq:alpha_lb}, the tail
  inequality for hypergeometric variables (Lemma~\ref{lem:hypergeometric})
  proves inequality~(\ref{eq:claim_case1}) for the number of sets~$N$
  satisfying Case~1 and with a given set~$Y=Y(N)$ (see
  Remarks~\ref{remark:Y_depends_N} and~\ref{remark:number_of_Y}).  To complete
  the proof of this case, it suffices to notice that summing over all the
  possible~$Y$ contributes little enough to our estimate (see
  Remark~\ref{remark:number_of_Y}).  Let us turn to the detailed
  calculations. 
  
  We apply Lemma~\ref{lem:hypergeometric} to estimate the probability
  that~$|N\cap W'|$ should be as large as~$\alpha d_2'$, given
  that~\eqref{eq:alpha_lb} holds.  From~\eqref{eq:alpha_lb}, we have that
  \begin{equation}
    \label{eq:k(6)_value}
    k(\ref{lem:hypergeometric})=\alpha d_2'\geq{\gamma\over3C}d_2'.
  \end{equation}
  Moreover, from~\eqref{eq:W'_upbd} we know that
  \begin{equation}
    \label{eq:lambda(6)_def}
    k(\ref{lem:hypergeometric})
    =\lambda(\ref{lem:hypergeometric})\EE(|N\cap W'|)
    =\lambda(\ref{lem:hypergeometric}){d_2'|W'|\over m_2}
    \leq2\epsilon\lambda(\ref{lem:hypergeometric})d_2'.
  \end{equation}
  From~\eqref{eq:k(6)_value} and~\eqref{eq:lambda(6)_def} we obtain that
  \begin{equation}
    \label{eq:lambda(6)_lbd}
    \lambda(\ref{lem:hypergeometric})\geq{\gamma\over6C\epsilon}.
  \end{equation}
  Therefore, Lemma~\ref{lem:hypergeometric} tells us that
  \begin{equation}
    \label{eq:first_prob_bd}
    \PP(|N\cap W'|\geq\alpha d_2')\leq\(\e\over\lambda\)^{\alpha d_2'}
    \leq\(6\e C\epsilon\over\gamma\)^{(\gamma/3C)d_2'}.
  \end{equation}
  Thus, for a fixed set~$Y$, the number of sets~$N$ with~$Y=Y(N)$ (see
  Remark~\ref{remark:Y_depends_N}) that fall into Case~1 is 
  \begin{equation}
    \label{eq:bd_for_fixed_Y}
    \leq\(6\e C\epsilon\over\gamma\)^{(\gamma/3C)d_2'}{m_2\choose d_2'}.
  \end{equation}
  Now recall~\eqref{eq:no_Y_upbd} in Remark~\ref{remark:number_of_Y}.  Using
  that~$d_2'\sim_\epsilon d_2$, and hence~$d_2\leq d_2'/(1-\epsilon)$, we have
  that the total number of possible sets~$Y$ is bounded from above by
  \begin{equation}
    \label{eq:no_of_Y_bis}
    \leq(1+o(1))^{d_2}\leq2^{d_2'}.
  \end{equation}
  Finally, using~\eqref{eq:bd_for_fixed_Y} and~\eqref{eq:no_of_Y_bis} and
  recalling that~$\epsilon\leq\epsilon_0$
  (see~\eqref{eq:epsilon_claim10_def}), where~$\epsilon_0$
  satisfies~\eqref{eq:requirement_for_epsilon}, we deduce that the total
  number of sets~$N$ is question is
  \begin{equation}
    \label{eq:final_bd_case1}
    \leq\left\{2\(6\e C\epsilon\over\gamma\)^{\gamma/3C}\right\}^{d_2'}
    {m_2\choose d_2'}
    \leq\(\beta_1\over2\)^{d_2'}{m_2\choose d_2'}
    \leq{1\over2}\beta_1^{d_2'}{m_2\choose d_2'}.
  \end{equation}
  Inequality~\eqref{eq:final_bd_case1} shows that the bound
  in~\eqref{eq:claim_case1} does indeed hold in this case, and hence the proof
  of this case is finished.   
  %
  \endcasebody
  
  \assertion{Case 2.}\enspace$|\vB^-|\geq(\eta/10)m_1$
  \endassertion
  %
  \casebody Our aim is to show that the number of sets~$N$ as in the statement
  of the claim that fall in this case is
  \begin{equation}
    \label{eq:claim_case2}
    \leq{1\over2}\beta_1^{d_2'}{m_2\choose d_2'}.
  \end{equation}
  The proof of this statement is similar to the proof in Case~1 above, but
  somewhat simpler.  We shall only give a brief outline of the proof.  We
  first observe that a statement analogous to~(\dag) may be proved in the same
  manner, except that we have, in this case, a set~$Y\subset\vB^-$ satisfying
  conditions (\textit{i})--(\textit{iii}) of~(\dag).  We then
  estimate~$e(N,Y)$ in two ways.  First, we observe that,
  because~$Y\subset\vB^-$, we have
  \begin{equation}
    \label{eq:e(N,Y)_upbd_case2}
    e(N,Y)\leq(1-\gamma)|Y|{d_2'd_2\over m_2}.
  \end{equation}
  However, we have
  \begin{equation}
    \label{eq:e(N,Y)_lwbd_case2}
    e(N,Y)\geq\sum_{w\in N\setminus W'}|\Gamma(w)\cap Y|
    \geq|N\setminus W'|(1-2\epsilon)\bd_Y.
  \end{equation}
  Comparing~\eqref{eq:e(N,Y)_upbd_case2}
  and~\eqref{eq:e(N,Y)_lwbd_case2}, we deduce that~$N\setminus W'$
  must be small, that is, the random set~$N$ must intersect the
  set~$W'$ of exceptional vertices substantially.  An application of
  the tail inequality for the hypergeometric distribution,
  Lemma~\ref{lem:hypergeometric}, finishes the proof of this case.
  %
  \endcasebody

  This concludes the proof of Claim~\ref{claim:half_pcl}.
\end{proof}

\subsubsection{Proof of the pair condition lemma, r.gs version}
\label{sec:pfofpclrgs}
Here we use Lemma~\ref{lem:pcl} to prove Theorem~\ref{cor:pcl}.  The basic
idea in the proof is the one discussed in Section~\ref{sec:philosophy}:
Lemma~\ref{lem:pcl} shows that the family of `unwanted' subgraphs in our
random graph is thin, and hence a simple first moment calculation will tell us
that such subgraphs do not occur in our random graphs almost surely (recall
Remark~\ref{rem:beta-thinness_Lemma_8}).

\begin{proof}[Proof of Theorem~\ref{cor:pcl}]
  Let~$\alpha$ and~$\gamma>0$ be given.  We apply Lemma~\ref{lem:pcl}
  with $\beta(\ref{lem:pcl})=\alpha/4\e$,
  $\gamma(\ref{lem:pcl})=\gamma$, and~$C(\ref{lem:pcl})=3/\alpha$.
  Lemma~\ref{lem:pcl} gives us a
  constant~$\epsilon(\ref{lem:pcl})>0$.  We claim that
  $\epsilon=\alpha\epsilon(\ref{lem:pcl})/2$ will do in
  Theorem~\ref{cor:pcl}.  Let us proceed to prove this claim.
  
  We may and shall assume that our~$G=G(n,q)$ is such that the almost
  sure property specified in Lemma~\ref{lem:ECB_rgs} is satisfied
  with~$\delta=\delta(\ref{lem:ECB_rgs})=1/2$.  In other words, we assume
  that
  \begin{enumerate}
  \item[(*)] if~$U$ and~$W$ are two disjoint sets of vertices of~$G$
    with~$|U|$ and~$|W|\gg q^{-1}\log n$, then
    \begin{equation}
      \label{eq:e(A,B)_bound}
      e(U,W)\sim_{1/2}q|U||W|.
    \end{equation}
  \end{enumerate}
  
  Let us estimate the expected number of
  `counterexamples'~$B=(U,W;E)\subset G$ with fixed~$m_1=|U|$,
  $m_2=|W|$, and~$T=e(B)$.  Observe that
  \begin{equation}
    \label{eq:p_condition}
    p={e(B)\over m_1m_2}\geq{\alpha e(G[U,W])\over m_1m_2}
    \geq{\alpha\over2}q.
  \end{equation}
  Thus, $p^2\min\{m_1,m_2\}\geq(\alpha^2/4)q^2m_0\gg(\log n)^4$
  (see~\eqref{eq:p_lbd}) and hence~\eqref{eq:T_joint_degree_condition}, and
  therefore~\eqref{eq:T_lbd}, are satisfied.  We now observe that~$B=(U,W;E)$
  is $(\epsilon(\ref{lem:pcl}),p)$-regular, since it is~$(\epsilon,q)$-regular
  and~\eqref{eq:p_condition} holds.  Finally, we check that
  property~$\ECB(U,W;C(\ref{lem:pcl}))$ holds for~$B$.  Indeed, it suffices to
  apply~(*) after observing that
  \begin{equation}
    \label{eq:m_condition}
    q{d\over(\log m)^3}\geq q{pm\over(\log n)^3}
    \geq{(\alpha/2)q^2m\over(\log n)^3}\gg\log n.
  \end{equation}
  
  The discussion above tells us that a counterexample~$B\subset G$ is
  a member of the family of graphs whose cardinality is estimated in
  Lemma~\ref{lem:pcl}.  Applying the estimate~\eqref{eq:pcl_upbd}, we
  obtain that, for fixed~$m_1$, $m_2$, and~$T$, the expected number of
  such counterexamples is
  \begin{multline}
    \label{eq:cor_pcl_final_estimate}
    \leq n^{m_1+m_2}\beta^T{m_1m_2\choose T}q^T
    \leq n^{m_1+m_2}\({\e\beta m_1m_2\over T}q\)^T\\
    \leq n^{m_1+m_2}\(\e\beta{q\over p}\)^T
    \leq n^{m_1+m_2}\(2\e\beta\over\alpha\)^T
    \leq\(2\over3\)^T.
  \end{multline}
  Summing~\eqref{eq:cor_pcl_final_estimate} over all possible~$m_1$,
  $m_2$, and~$T$, our result follows.
\end{proof}

\subsection{A local condition for regularity}
\label{sec:local_condition}
In this section, we state and prove a lemma that gives a sufficient condition
for a possibly sparse bipartite graph to be $\epsilon$-regular.  The condition
is local in nature.  Similar results in somewhat different contexts have
proved to be very useful;
see~\cite{%
AlonDLRY92,%  
alon94,%
babai86:_compl,%
chung89,%
DukeLefmannRodlcount,%
frankl88,%
thomason87,%
thomason87:_random%,%
}
and the proof of the upper bound in Theorem~15.2 in~\cite{erd74:_probab},
due to J.$\,$H.~Lindsey. 

\subsubsection{The statement of the lemma}
\label{sec:mx_lemma_state}
Our lemma giving local conditions for the regularity of possibly sparse
bipartite graphs is as follows.

\begin{lemma}[The local condition lemma]
  \label{lem:mx_lemma}
  For all~$\epsilon>0$ and all~$C\geq1$, there is~$\delta>0$ such that
  any bipartite graph~$B=(U,W;E)$ satisfying properties 
  \begin{equation}
    \label{eq:mx_lemma_hyp}
    \ChUB(U,W;\delta,C),\;\D(U,W;\delta,\epsilon)\text{ and } 
     \PC(U,W;\delta)
  \end{equation}
  is $\epsilon$-regular with respect to density~$p=e(U,W)/|U||W|$, as
  long as~$p|U|\geq1/\epsilon\delta$.  
\end{lemma}

\begin{remark}
  Note that property $\ChUB(U,W;o(1),O(1))$ is always satisfied in the
  dense case, and hence Lemma~\ref{lem:mx_lemma} above reduces to the
  well-known criterion for regularity that, in our language, asserts
  that properties $\D(U,W;o(1),o(1))$ and $\PC(U,W;o(1))$ imply
  $o(1)$-regularity.
\end{remark}

We now state a result that guarantees the $o(1)$-regularity of `large'
bipartite subgraphs~$H=(U,W;E)$ of random graphs when~$H$ is known to satisfy
property~$\PC(U,W;o(1))$.  This result follows from Lemma~\ref{lem:mx_lemma}.

\begin{theorem}[The local condition lemma, r.gs~version]
  \label{cor:mx_lemma_rgs}
  Let~$0<q=q(n)<1$ and~$m_0=m_0(n)$ be such that
  \begin{equation}
    \label{eq:lcl_rgs_q_cond}
    q^2m_0\gg\log n.
  \end{equation}
  Then, for all~$\alpha>0$ and all~$\epsilon>0$, there is~$\delta>0$
  such that almost all random graphs~$G=G(n,q)$ satisfy the
  following property.  Suppose~$U$, $W\subset V(G)$ with~$U\cap
  W=\emptyset$ and~$|U|$, $|W|\geq m_0$ and~$F\subset E(G[U,W])$ with
  $T=|F|\geq\alpha e(G[U,W])$ are such that~$H=(U,W;F)$ satisfies 
  \begin{equation}
    \label{eq:cor:mx_lemma_rgs}
    \D(U,W;\delta,\epsilon)\text{\quad and\quad}\PC(U,W;\delta).
  \end{equation}
  Then the graph~$H=(U,W;F)$ is an $\epsilon$-regular bipartite graph
  with respect to density~$\rho=T/|U||W|$. 
\end{theorem}

\subsubsection{Proof of the local condition lemma}
\label{sec:pfofmxlemma}
Here we prove Lemma~\ref{lem:mx_lemma}.

\begin{proof}[Proof of Lemma~\ref{lem:mx_lemma}]
  Let~$0<\epsilon<1$ and~$C\geq1$ be given.  Put
  \begin{equation}
    \label{eq:pf_lcl_delta_def}
    \delta={\epsilon^5\over7C}.
  \end{equation}
  Note for later reference that, then, we have
  \begin{equation}
    \label{eq:pf_lcl_delta_prop}
    \left\{{\delta\over\epsilon}
    \(6+{2C\over\epsilon^2}\)\right\}^{1/2}\leq\epsilon.
  \end{equation} 
  We shall now show that the choice for~$\delta$ given
  in~\eqref{eq:pf_lcl_delta_def} will do.

  Fix a bipartite graph~$B=(U,W;E)$ satisfying the hypothesis of our lemma.
  Let sets~$U'\subset U$ and~$W'\subset W$ with~$|U'|\geq\epsilon|U|$
  and~$|W'|\geq\epsilon|W|$ be given.  As usual, put~$m_1=|U|$
  and~$m_2=|W|$, $p=T/m_1m_2$, where~$T=e(B)$, and, also, let
  $m_1'=|U'|$ and $m_2'=|W'|$.  We aim at estimating the `error'  
  \begin{equation}
    \label{eq:mx_error_2_estimate}
    \big|e(U',W')-p|U'||W'|\big|.
  \end{equation}
  Let us define a matrix~$A=(a_{u,w})$ whose elements are indexed by~$U\times
  W$.  We put
  \begin{equation}
    \label{eq:mx_elements_def}
    a_{u,w}=
    \begin{cases}
      -(1-p)&\text{if~$\{u,w\}\in E(B)$}\\
      p&     \text{otherwise.}
    \end{cases}
  \end{equation}
  Let
  \begin{equation}
    \label{eq:beta_w}
    \beta_w=\sum\{a_{u,w}\:u\in U'\}
  \end{equation}
  and put~$\bbeta=(\beta_w)_{w\in W}$.  We apply the Cauchy--Schwarz
  inequality to obtain that
  \begin{equation}
    \label{eq:CS_on_beta}
    \sum_{w\in W}\beta_w^2\geq\sum_{w\in W'}\beta_w^2
    \geq{1\over|W'|}\(\sum_{w\in W'}\beta_w\)^2.
  \end{equation}
  Observe that
  \begin{equation}
    \label{eq:error_square}
    \begin{split}
      \(\sum_{w\in W'}\beta_w\)^2
      &=\(\sum_{(u,w)\in U'\times W'}a_{u,w}\)^2\\
      &=\{-(1-p)e(U',W')+p\(m_1'm_2'-e(U',W')\)\}^2\\
      &=\{pm_1'm_2'-e(U',W')\}^2,
    \end{split}
  \end{equation}
  which is the square of the `error'~\eqref{eq:mx_error_2_estimate} that we
  wish to estimate.  Now, on the other hand, we have
  \begin{equation}
    \label{eq:individual_square}
    \beta_w^2=\(\sum_{u\in U'}a_{u,w}\)^2
    =\sum_{(u,u')\in U'\times U'}a_{u,w}a_{u',w}.
  \end{equation}
  Thus
  \begin{equation}
    \label{eq:scalar_prod}
    \sum_{w\in W}\beta_w^2
    =\sum_{(u,u')\in U\times U'}\sum_{w\in W}a_{u,w}a_{u',w}
    =\sum_{(u,u')\in U\times U'}\<\balpha_u,\balpha_{u'}\>,
  \end{equation}
  where~$\balpha_u=(a_{u,w})_{w\in W}$ and similarly for~$\balpha_{u'}$.  Let
  us consider the inner products in~\eqref{eq:scalar_prod}.  Consider first
  the case in which~$u=u'$.  Writing~$d(x)=d_B(x)$ for the degree of a
  vertex~$x$ in~$B$, we have, for any~$u\in U$,
  \begin{equation}
    \label{eq:u=u'_case}
    \begin{split}
      \<\balpha_u,\balpha_u\>
      &=d(u)(1-p)^2+(m_2-d(u))p^2\\
      &=d(u)(1-2p+p^2)+(m_2-d(u))p^2\\
      &=d(u)(1-2p)+m_2p^2.
    \end{split}
  \end{equation}
  Suppose now that~$u\neq u'$ ($u$, $u'\in U$).  As usual, 
  put~$d(x,y)=d_B(x,y)=|\Gamma_B(x)\cap\Gamma_B(y)|$ for any two vertices~$x$
  and~$y$ of~$B$.  Then
  \begin{equation}
    \label{eq:u_neq_u'_case}
    \begin{split}
       \<\balpha_u,\balpha_{u'}\>
       &=(1-p)^2d(u,u')-p(1-p)\{d(u)-d(u,u')+d(u')-d(u,u')\}\\
       &\qquad\qquad+p^2\{m_2-d(u)-d(u')+d(u,u')\}\\
       &=d(u,u')\((1-p)^2+2p(1-p)+p^2\)\\
       &\qquad\qquad+d(u)\(-p(1-p)-p^2\)+d(u')\(-p(1-p)-p^2\)+m_2p^2\\
       &=d(u,u')-(d(u)+d(u'))p+m_2p^2.    
    \end{split}
  \end{equation}
  Putting~\eqref{eq:CS_on_beta}, \eqref{eq:error_square},
  \eqref{eq:scalar_prod}, \eqref{eq:u=u'_case} and~\eqref{eq:u_neq_u'_case}
  together, we obtain that
  \begin{align}
    &{1\over|W'|}\{pm_1'm_2'-e(U',W')\}^2
    ={1\over|W'|}\(\sum_{w\in W'}\beta_w\)^2\label{eq:error_bound_}\\
    &\qquad\qquad\qquad
    \leq\sum_{(u,u')\in U'\times U'}
    \<\balpha_u,\balpha_{u'}\>\label{eq:error_bound__}\\
    &\qquad\qquad\qquad
    =\sum_{u\in U'}\(d(u)(1-2p)+m_2p^2\)\label{eq:error_bound1}\\
    &\qquad\qquad\qquad\qquad\qquad
    +\sum_{(u,u')}\nolimits'\(d(u,u')-(d(u)+d(u'))p+m_2p^2\),
    \label{eq:error_bound2}
  \end{align}
  where~$\sum_{(u,u')}'$ stands for sum over all pairs~$(u,u')\in U'\times U'$ 
  with~$u\neq u'$.  We now estimate the sums in~\eqref{eq:error_bound1}
  and~\eqref{eq:error_bound2} separately.  We start
  with~\eqref{eq:error_bound2}.  Clearly, 
  \begin{equation}
    \label{eq:u_neq_u'_sum}
    \sum_{(u,u')}\nolimits'\(d(u,u')-(d(u)+d(u'))p+m_2p^2\)
    =\Sigma_1+\Sigma_2,
  \end{equation}
  where
  \begin{equation}
    \label{eq:Sigma1_def}
    \Sigma_1=\sum_{(u,u')}\nolimits'\(d(u,u')-m_2p^2\)
  \end{equation}
  and
  \begin{equation}
    \label{eq:Sigma2_def}
    \Sigma_2=p\sum_{(u,u')}\nolimits'\(2m_2p-(d(u)+d(u'))\).
  \end{equation}
  To estimate~$\Sigma_1$, we split the sum in~\eqref{eq:Sigma1_def} according
  to whether or not 
  \begin{equation}
    \label{eq:F(delta)}
    \{u,u'\}\in F(\delta)=F(U,W;\delta)\subset{U\choose2}
  \end{equation}
  (see~\eqref{eq:F_gamma}).  Note that, because of property~$\PC(U,W;\delta)$
  (cf.~Definition~\ref{def:PC_def}), we know that
  \begin{equation}
    \label{eq:F(delta)_size}
    |F(\delta)|=|F(U,W;\delta)|\leq\delta{|U|\choose2}=\delta{m_1\choose2}. 
  \end{equation}
  Since property~$\ChUB(U,W;\delta,C)$ holds (see~\eqref{eq:ChUB}),
  relations~\eqref{eq:F(delta)} and~\eqref{eq:F(delta)_size} imply that
  \begin{equation}
    \label{eq:F(delta)_sum}
    \sum\big\{d(u,u')\:{\{u,u'\}\in F(\delta)}\big\}
    \leq C\delta p^2m_1^2m_2.
  \end{equation}
  Turning back to the estimate of~$\Sigma_1$ in~\eqref{eq:Sigma1_def}, we
  use~\eqref{eq:F(delta)_sum} to deduce that 
  \begin{equation}
    \label{eq:Sigma1_split}
    \begin{split}
    \Sigma_1&=2\sum_{\{u,u'\}\notin F(\delta)}\(d(u,u')-m_2p^2\)\\
    &\qquad\qquad\qquad\qquad%\qquad\qquad
    +2\sum_{\{u,u'\}\in F(\delta)}\(d(u,u')-m_2p^2\)\\
    &\leq2\delta p^2m_2{m_1'\choose2}
    +2\sum_{\{u,u'\}\in F(\delta)}d(u,u')\\
    &\leq\delta p^2m_2(m_1')^2+2C\delta p^2m_1^2m_2\\
    &\leq(2C/\epsilon^2+1)\delta p^2(m_1')^2m_2,
    \end{split}
  \end{equation}
  where in the last inequality we used that~$m_1'=|U'|\geq\epsilon|U|=\epsilon
  m_1$.  The estimation of~$\Sigma_2$ will be based on
  property~$\D(U,W;\delta,\epsilon)$.  We invoke~$\D(U,W;\delta,\epsilon)$ to
  obtain that
  \begin{equation}
    \label{eq:error_bound1_estimate0}
     (1-\delta)pm_1'm_2\leq e(U',W)\leq(1+\delta)pm_1'm_2 
  \end{equation} 
  (cf.~\eqref{eq:D(U,W,delta,epsilon)}).
  Using~\eqref{eq:error_bound1_estimate0}, we see that 
  \begin{equation}
    \label{eq:Sigma2_upbd}
    \begin{split}
      \Sigma_2&=p\(2pm_2m_1'(m_1'-1)-2(m_1'-1)\sum_{u\in U'}d(u)\)\\
      &=2(m_1'-1)p\{pm_1'm_2-e(U',W)\}\\
      &\qquad\qquad\leq2(m_1'-1)p\times\delta pm_1'm_2
       \leq2\delta p^2(m_1')^2m_2.
    \end{split}
  \end{equation}
  It remains to estimate the sum in~\eqref{eq:error_bound1}.  We again
  use~\eqref{eq:error_bound1_estimate0} to deduce that the sum
  in~\eqref{eq:error_bound1} is
  \begin{multline}
    \label{eq:error_bound1_estimate}
    (1-2p)e(U',W)+m_1'm_2p^2\leq(1+\delta)pm_1'm_2+m_1'm_2p^2\\
    ={1+\delta+p\over m_1'p}p^2(m_1')^2m_2
    \leq{3\over m_1'p}p^2(m_1')^2m_2.
  \end{multline}
  We now use that~$m_1'\geq\epsilon m_1$ and that~$pm_1\geq1/\epsilon\delta$
  to conclude that the last term in~\eqref{eq:error_bound1_estimate} is
  \begin{equation}
    \label{eq:error_bound1_estimate2}
    \leq{3\over\epsilon m_1p}p^2(m_1')^2m_2
    \leq3\delta p^2(m_1')^2m_2.
  \end{equation}
  
  Putting together~\eqref{eq:error_bound_}--\eqref{eq:error_bound2}
  and~\eqref{eq:Sigma1_split}--\eqref{eq:error_bound1_estimate}, we have
  \begin{equation}
    \label{eq:mx_lemma_final}
    {1\over m_2'}\{pm_1'm_2'-e(U',W')\}^2
    \leq\(3\delta+\({2C\over\epsilon^2}+1\)\delta+2\delta\)p^2(m_1')^2m_2.
  \end{equation}
  Recalling the condition~$m_2'\geq\epsilon m_2$ and
  inequality~\eqref{eq:pf_lcl_delta_prop}, we deduce
  that~\eqref{eq:mx_error_2_estimate} is at most~$\epsilon
  pm_1'm_2'$, and our proof is finished.
\end{proof}

\subsubsection{Proof of the local condition lemma, r.gs version}  
\label{sec:pfofmxlemma_rgs}
Theorem~\ref{cor:mx_lemma_rgs} follows easily from
Lemma~\ref{lem:mx_lemma}.  

\begin{proof}[Sketch of the proof of Theorem~\ref{cor:mx_lemma_rgs}] 
  Because of condition~\eqref{eq:lcl_rgs_q_cond}, we know that
  property $\ChUB(U,W;\delta,\Cchub)$ holds almost surely for
  $\Cchub=2/\alpha^2$ and any~$\delta>0$.  We
  pick~$\delta=\delta(\epsilon,\Cchub)>0$ as given by
  Lemma~\ref{lem:mx_lemma}.  The condition
  that~$p|U|\geq\epsilon\delta$ should hold is immediate.  The
  hypotheses given in Lemma~\ref{lem:mx_lemma} for our bipartite
  graph~$B=(U,W;E)$ are now all satisfied, and the
  $\epsilon$-regularity of~$B$ follows.
\end{proof}

\subsection{The one-sided neighbourhood lemma}
\label{sec:1-sided_nbhd_lemma}
Our aim in this section is to prove a lemma concerning certain induced
subgraphs of sparse $\epsilon$-regular bipartite graphs.  As always, we shall
be interested in such $\epsilon$-regular bipartite graphs that arise as
subgraphs of r.gs.  Roughly speaking, we show that almost every r.g.~has the
property that any large and dense enough $\epsilon$-regular bipartite
subgraph~$H=(U,W;F)$ of it is such that the neighbourhood~$\Gamma_H(w)$ of
almost all vertices~$w\in W$ induces, together with~$W$,
% the vertex class of~$w$,
an $\epsilon'$-regular bipartite graph in~$H$.  Here, we may
make~$\epsilon'>0$ as small as we wish by taking~$\epsilon>0$ correspondingly
small.

This somewhat long section is organized as follows.  In
Section~\ref{sec:induced_subgraphs}, we state two auxiliary lemmas,
Lemmas~\ref{lem:1-sided_nbhd_lemma} and~\ref{lem:exceptional_bd}.  In the
following section, we state a counting version of the main result of
Section~\ref{sec:1-sided_nbhd_lemma}, Lemma~\ref{lem:1-sided_nbhd_lemma2}, and
in the next section we state a consequence of the previous results concerning
random graphs, cf.~Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.  All the
proofs are given in the second part of Section~\ref{sec:1-sided_nbhd_lemma}.
In Section~\ref{sec:pfof_1-sided}, we give the proofs of
Lemmas~\ref{lem:1-sided_nbhd_lemma} and~\ref{lem:exceptional_bd}; in these
proofs, we make use of an auxiliary lemma, Lemma~\ref{lem:D_is_hereditary},
which is proved towards the end of Section~\ref{sec:pfof_1-sided}.  In
Section~\ref{sec:1-sided_nbhd_lemma_cv}, we give the proof of
Lemma~\ref{lem:1-sided_nbhd_lemma2} and in the final section,
Section~\ref{sec:1-sided_nbhd_lemma_rgs}, we are finally able to prove
Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.

\subsubsection{Statement of the one-sided neighbourhood lemma, auxiliary
  version} 
\label{sec:induced_subgraphs}
Let us describe the situation that is of our concern in this section.  Suppose
that we have a bipartite graph~$B$ on~$(U,W)$.  We shall be interested in the
following assertions, definitions, and notation concerning the bipartite
graph~$B$.
\begin{enumerate}
  \item[(I)]$|U|=m_1$, $|W|=m_2$, $T=e(B)$, $p=T/m_1m_2$, and~$d_i=pm_i$
    ($i\in\{1,2\}$). 
  \item[(II)]
    \begin{enumerate}
      \item[(\textit{a})]Property~$\D(U,W;\eta_0,\epsilon')$ holds.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       that is, for all~$\tU\subset U$ with~$|\tU|\geq\epsilon|U|$, we
%       have 
%       \begin{equation}
%         \label{eq:D(U,W;eta_0,epsilon)}
%         \big|e(\tU,W)-p|\tU||W|\big|\leq\eta_0p|\tU||W|.
%       \end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      \item[(\textit{b})]Property~$\PC(U,W;\delta)$ holds.  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%         that is, if 
%         \begin{equation}
%           \label{eq:F_delta_SNL}
%           F(U,W;\delta)
%              =\left\{\{x,y\}\in{U\choose2}\:
%                \left|d_W^B(x,y)-{d_2^2\over m_2}\right|
%           \geq\delta{d_2^2\over m_2}\right\}, 
%         \end{equation}
%         where~$d_W^B(x,y)=\big|W\cap\Gamma_B(x)\cap\Gamma_B(y)\big|
%         =\big|\Gamma_B(x)\cap\Gamma_B(y)\big|$ and~$d_2=T/m_1$,
%         then~$|F(U,W;\delta)|\leq\delta{m_1\choose2}$. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      \end{enumerate}  
  \item[(III)]
  \begin{enumerate}
  \item[(\textit{a})]We write~$\cE(d_1';\eta_1,\Cchub)$ for the family of
    subsets~$U'\subset U$ of cardinality~$d_1'$ for which
    $\ChUB(U',W;\eta_1,\Cchub)$ \textit{fails}.  Below, we shall be interested
    in $d_1'$-sets~$U'$ with~$d_1'\sim_{\sigma'}d_1$.  We shall sometimes
    refer to the members of~$\cE(d_1';\eta_1,\Cchub)$ as the
    \textit{exceptional sets}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    For all~$U'\subset U$ with~$|U'|=d_1'\sim_{\sigma'}d_1$,
%    property~$\ChUB(U',W;\eta_1,\Cchub)$ holds.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       That is,
%       \begin{equation}
%         \label{eq:iiiaChUB}
%         \sum_{\{x,y\}\in F}d_W^B(x,y)\leq\Cchub p^2d_1^2m_2
%       \end{equation}
%       for any $F\subset{U'\choose2}$ with~$|F|\leq\eta_0{U'\choose2}$.  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \item[(\textit{b})]Property~$\ECB(U,W;\Cecb)$ holds.  In particular,
    if~$\bU\subset U$ is such that~$|\bU|\geq d/(\log m)^3$, then
    \begin{equation}
      e(\bU,W)\leq\Cecb p|\bU||W|,
    \end{equation}
    where, as before, $d=\min\{d_1,d_2\}$ and~$m=m_+=\max\{m_1,m_2\}$. 
  \end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   \item[(IV)]For all~$U'\subset U$ with~$|U'|=d_1$ such that
%     $(U',W)$ is $\epsilon$-regular with respect to density~$p$, we
%     have property~$\PC(W,U';\delta')$. 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %     that is, if
% %     \begin{equation}
% %       \label{eq:F_delta_SNLiv}
% %       F(W,U';\delta')
% %          =\left\{\{x,y\}\in{U\choose2}\:
% %            \left|d_{U'}^B(x,y)-p^2d_1\right|
% %          \geq\delta'p^2d_1\right\}, 
% %     \end{equation}
% %     where~$d_{U'}^B(x,y)=\big|U'\cap\Gamma_B(x)\cap\Gamma_B(y)\big|$
% %     and~$d_1=T/m_2$, then
% %     \begin{equation}
% %       \label{eq:F_delta_SNLiv_upbd}
% %       |F(W,U';\delta)|\leq\delta'{m_2\choose2}.  
% %     \end{equation}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{enumerate}

Our first auxiliary lemma concerns certain sets~$U'\subset U$ that are
`undesirable,' given the set-up in~(I)--(III) above.  For constants~$\sigma>0$
and~$\epsilon>0$, we consider the following properties for the set~$U'$:
\begin{itemize}
\item[(\textit{a})] $\rho=e(B[U',W])/d_1'm_2\sim_\sigma p=T/m_1m_2$. 
\item[(\textit{b})] $B[U',W]$ is $(\epsilon,\rho)$-regular. 
\end{itemize}
We let
\begin{equation}
  \label{eq:cI_def}
  \cI(d_1';\sigma,\epsilon)=\{U'\subset U\:|U'|=d_1'\text{
    and \textit{either}~(\textit{a}) \textit{or}~(\textit{b})
    \textit{fails}}\}.   
\end{equation}
%The first auxiliary lemma that we shall need is as follows.

\begin{lemma}[One-sided neighbourhood lemma, auxiliary version]
  \label{lem:1-sided_nbhd_lemma}
  For all~$\beta>0$, $\epsilon>0$, $\sigma>0$, $0<\sigma'<1$, $\Cchub>0$,
  and~$\Cecb>0$, there exist constants~$\epsilon'>0$, $\delta>0$, $\eta_0>0$,
  and~$\eta_1>0$ such that if~$B$ satisfies properties~{\rm(I)}--{\rm(III)}
  and~$d_1'\sim_{\sigma'}d_1$, then
  \begin{equation} 
    \label{eq:1-sided_nbhd_lemma}
    |\cI(d_1';\sigma,\epsilon)\setminus\cE(d_1';\eta_1,\Cchub)|
    \leq\beta^{d_1'}{m_1\choose d_1'},
  \end{equation}
  provided that~$m_1\gg1/p^2$.
\end{lemma}

\begin{remark}
  \label{rem:not_count_exceptional}
  Lemma~\ref{lem:1-sided_nbhd_lemma} excludes from the family of sets that it
  counts the exceptional $d_1'$-sets~$U'\subset U$.  Roughly speaking
  {\rm(}and this may be seen in the proof of this lemma in
  Section~\ref{sec:pfof_1-sided}{\rm)}, to assert~$(\textit{b})$ for a
  set~$U'$, that is, the $(\epsilon,\rho)$-regularity of~$B[U',W]$, we shall
  make use of the local condition lemma for regularity,
  Lemma~\ref{lem:mx_lemma}.  This lemma requires as a hypothesis
  property~$\ChUB(U',W;\eta_1,\Cchub)$, which is guaranteed for
  non-exceptional sets~$U'$ only {\rm(}see~{\rm(III)(\textit{a})}{\rm)}.
\end{remark}

For Lemma~\ref{lem:1-sided_nbhd_lemma} to be useful later, we need to have
some control on the number of exceptional sets.  It turns out that a condition
of the following form will apply when we make use of that lemma.
\begin{enumerate}
  \item[(III)]
  \begin{enumerate}
  \item[(\textit{a$'$})]For all~$U'\subset U$
    with~$d_1'=|U'|\sim_{\sigma'}d_1$, we have that 
    \begin{equation}
      \label{eq:AxCHUB_F_Q}
      \text{for all }F'\subset{U'\choose2}
      \text{\quad such that\quad}|F'|\leq\eta_1{|U'|\choose2},     
    \end{equation}
    we have
    \begin{equation}
      \label{eq:AxChUB(C,delta)_Q}
      \sum_{\{x,y\}\in F'}d_W^B(x,y)\leq Q\eta_1 p^2|U'|^2|W|, 
    \end{equation}
    where~$d_W^B(x,y)=\big|\Gamma_B(x)\cap\Gamma_B(y)\big|$.
  \end{enumerate}
\end{enumerate}
In~(III)(\textit{a$'$}) above, $Q$ is some constant independent of~$n$.
Probably only the extremely meticulous reader will notice the difference
between properties~(III)(\textit{a$'$}) and~$\ChUB(U',W;\eta_1,Q)$, since the
difference is quite subtle.  In~(III)(\textit{a$'$}), the density (squared)
appearing on the right-hand side of~\eqref{eq:AxChUB(C,delta)_Q}
is~$p=e(B)/|U||W|$.  Property~$\ChUB(U',W;\eta_1,Q)$ would require this to
be~$\rho=e(B[U',W])/|U'||W|$, which may be smaller than~$p$.

The whole point of Lemma~\ref{lem:exceptional_bd} below is to show that~$\rho$
is not a great deal smaller than~$p$ for an overwhelming proportion of the
sets~$U'\subset U$.  Therefore, we are able to conclude that, with very high
probability, property~$\ChUB(U',W;\eta_1,Q')$ does hold for some
constant~$Q'>Q$ if~(III)(\textit{a$'$}) holds.  In other words,
Lemma~\ref{lem:exceptional_bd} tells us that a bipartite graph~$B=(U,W;E)$ as
in the statement of Lemma~\ref{lem:1-sided_nbhd_lemma} has very few
exceptional sets if~(III)(\textit{a$'$}) above holds.

To be more precise, we assume that assertions~(I), (II)(\textit{a}),
(III)(\textit{a$'$}) and~(\textit{b}) apply to our bipartite graph~$B=(U,W;E)$
(condition~(II)(\textit{b}) is not required).  We claim that, then,
\begin{equation}
  \label{eq:exceptional_bd}
  |\cE(d_1';\eta_1,Q')|\leq\betaexcept^{d_1'}{m_1\choose d_1'}
\end{equation}
holds for any given~$Q'>Q$ and~$\betaexcept>0$, as long as~$\epsilon'>0$
and~$\eta_0>0$ are suitably small.  Formally, we have the following lemma.

\begin{lemma}
  \label{lem:exceptional_bd}
  For any~$\betaexcept>0$, $Q\geq1$, $\sigma>0$, $\sigma'>0$, $\eta_1>0$,
  and~$\Cecb>0$, there exist~$\epsilon'>0$ and~$\eta_0>0$ such that the
  following assertion holds.  If~$B=(U,W;E)$ is a bipartite graph for
  which~{\rm(I)}, {\rm(II)(\textit{a})}, {\rm(III)(\textit{a$'$})}
  and~{\rm(\textit{b})} apply, then inequality~\eqref{eq:exceptional_bd}
  holds for all~$d_1'\sim_{\sigma'}d_1$ with~$Q'=Q/(1-\sigma)^2$.
\end{lemma}

\subsubsection{Statement of the one-sided neighbourhood lemma, counting
  version}
\label{sec:1-sided-couting}
We now turn to a corollary of Lemma~\ref{lem:1-sided_nbhd_lemma} in
Section~\ref{sec:induced_subgraphs}.  In fact,
Lemma~\ref{lem:1-sided_nbhd_lemma} has as a consequence a lemma that estimates
the number of certain bipartite graphs.  Roughly speaking, in our next lemma
we consider graphs~$B=(U,W;E)$ satisfying~(I)--(III) above that have many
vertices~$w\in W$ whose neighbourhood~$\Gamma(w)\subset U$ induces together
with~$W$ a graph that is not dense enough or, else, is not regular enough.
Unfortunately, we are actually able to prove a result that is technically
somewhat more cumbersome.  Let us turn to the precise statement of the result
that we shall prove.

Let~$B=(U,W;E)$ be a bipartite graph for which~(I), (II)(\textit{a})
and~(\textit{b}), and~(III)(\textit{a}) and~(\textit{b}) above apply.  In
fact, we shall further require the following condition:
\begin{enumerate}
  \item[(III)]
  \begin{enumerate}
  \item[(\textit{a$''$})]For all~$d_1'\sim_{\sigma'}d_1$, we have 
    have
    \begin{equation}
      \label{eq:cE_up_bd}
      |\cE(d_1';\eta_1,\Cchub)|\leq\betaexcept^{d_1'}{m_1\choose d_1'}.
    \end{equation}
  \end{enumerate}
\end{enumerate}
In~(III)(\textit{a$''$}) above, $\betaexcept$ is some small positive constant
independent of~$n$.  This technical condition will be required because
Lemma~\ref{lem:1-sided_nbhd_lemma} excludes the exceptional sets from the
estimate in~\eqref{eq:1-sided_nbhd_lemma} (see
Remark~\ref{rem:not_count_exceptional}).

We now let~$W'$ be a new set of vertices, with~$W'\cap(U\cup W)=\emptyset$.
We suppose that we have a bipartite graph~$B'=(U,W';E')$.  In applications
later, we shall consider the bipartite graph~$H=B\cup B'=(U,W\cup W';E\cup
E')$.

Let~$m'=|W'|$ and~$T'=e(B')$, and suppose that
\begin{equation}
  \label{eq:m'_lwbd}
  m'\geq\nu(|W|+|W'|)=\nu(m_2+m').  
\end{equation}
Furthermore, assume that
\begin{equation}
  \label{eq:p'_sim_p_condition}
  p'={T'\over m_1m'}\sim_{\sigma'}p,
\end{equation}
and suppose that 
\begin{equation}
  \label{eq:degree_cond}
  \begin{split}
    &\text{for at least~$m'/2$ vertices~$w'\in W'$, we have }\\
    &\qquad d_{B'}(w')=|\Gamma_{B'}(w')|\sim_{\sigma'}d_1=pm_1.
  \end{split}
\end{equation}
We may think of~\eqref{eq:m'_lwbd}--\eqref{eq:degree_cond} as `compatibility'
conditions for~$B'$ with respect to~$B$.  Now
let~$\tU=\tU(w')=\Gamma_{B'}(w')$.  We say that~$w'\in W'$ satisfying the
degree condition in~\eqref{eq:degree_cond} is
\textit{$(\epsilon,\sigma,\sigma';B,B')$-bad}, or simply \textit{bad}, if
\begin{equation}
  \label{eq:alternative_bad_def}
  \tU=\tU(w')=\Gamma_{B'}(w')\in
  \cI(d_1';\sigma,\epsilon)\cup\cE(d_1';\eta_1,\Cchub)
\end{equation}
(recall the definitions of these families of sets given in~\eqref{eq:cI_def}
and~(III)(\textit{a})).  For clarity, let us state explicitly the conditions
required for a vertex~$w'\in W'$ to be bad:
\begin{itemize}
  \item[(\textit{a})]
    either~$\rho_{w'}=e(B[\tU,W])/|\tU||W|\sim_\sigma p=T/m_1m_2$
    fails to hold,  
  \item[(\textit{b})] or~$B[\tU,W]$ is not $(\epsilon,\rho_{w'})$-regular, 
  \item[(\textit{c})] or else~$\tU\in\cE(|\tU|;\eta_1,\Cchub)$, that is,
    $\ChUB(\tU,W;\eta_1,\Cchub)$ fails to hold.
\end{itemize}
Let us now state the property of our current concern.
\begin{enumerate}
  \item[(IV)]The number of $(\epsilon,\sigma,\sigma';B,B')$-bad
    vertices~$w'\in W'$ is at least~$\mu m'$. 
\end{enumerate}
We are now ready to state our next lemma.

\begin{lemma}[One-sided neighbourhood lemma, counting version]
  \label{lem:1-sided_nbhd_lemma2}
  For all~$\beta>0$, $\epsilon>0$, $\mu>0$, $\nu>0$, $\sigma>0$,
  $0<\sigma'<1$, $\Cchub>0$, and~$\Cecb>0$, there exist
  constants~$\betaexcept>0$, $\epsilon'>0$, $\delta>0$, $\eta_0>0$,
  and~$\eta_1>0$, such that the number of pairs of compatible bipartite
  graphs~$(B,B')$, on fixed sets~$U$, $W$, and~$W'$, satisfying
  properties~{\rm(I)}, {\rm(II)(\textit{a})} and~{\rm(\textit{b})},
  {\rm(III)(\textit{a$''$})} and~{\rm(\textit{b})} and~{\rm(IV)} is
  \begin{equation} 
    \label{eq:1-sided_nbhd_lemma_version2}
    \leq\beta^\tT{m_1(m'+m_2)\choose\tT},
  \end{equation}
  where~$\tT=e(B)+e(B')$, as long as~$\tT\gg m'\log m'$.
\end{lemma}

\begin{remark}
  \label{rem:1-sided-thin-remark}
  For any given constants~$\epsilon$, $\mu$, $\nu$, $\sigma$, $\sigma'$,
  $\Cchub$, $\Cecb$, $\betaexcept$, $\epsilon'$, $\delta$, $\eta_0$,
  and~$\eta_1$ and any function~$\omega=\omega(m')$ with~$\omega\to\infty$
  as~$m'\to\infty$, we may define the family of bipartite graphs~$H$ that
  arise as the union~$B\cup B'$ for the pairs~$(B,B')$ that are counted in
  Lemma~\ref{lem:1-sided_nbhd_lemma2} with these parameters {\rm(}$\omega$ is
  used to define an explicit lower bound for~$\tT$; that is, we require
  that~$\tT\geq\omega m'\log m'${\rm)}.  For each possible
  order~$(m_1,m_2+m')$ of~$H$, we assume that all these graphs~$H$ are on some
  pair of fixed vertex classes~$(U_0,W_0)$.  Let
  \begin{equation}
    \label{eq:H_fam_def}
    \cH(U_0,W_0,\omega;\epsilon,\mu,\nu,\sigma,\sigma',\Cchub,\Cecb,
    \betaexcept,\epsilon',\delta,\eta_0,\eta_1)
  \end{equation}
  be the family of such graphs~$H$.
  
  Recall Definition~\ref{def:thin} and Remark~\ref{rem:bipartite_thin} from
  Section~\ref{sec:philosophy}.  Lemma~\ref{lem:1-sided_nbhd_lemma2} implies
  immediately that the family in~\eqref{eq:H_fam_def} is $\beta$-thin, as long
  as~$\betaexcept>0$, $\epsilon'>0$, $\delta>0$, $\eta_0>0$, and~$\eta_1>0$
  are suitably small.
  
  Finally, we observe that calculations analogous to the ones in the proof of
  Lemma~\ref{lem:Furedi} will show that, roughly speaking, random graphs
  almost surely do not contain `large' subgraphs isomorphic to the members of
  the family in~\eqref{eq:H_fam_def}
  {\rm(}cf.~Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}{\rm)}.    
\end{remark}

\subsubsection{Statement of the one-sided neighbourhood lemma, r.gs version}
\label{sec:1-sided-rgs}
We shall now state a result concerning random graphs that may be derived from
Lemmas~\ref{lem:exceptional_bd} and~\ref{lem:1-sided_nbhd_lemma2}.  It will be
convenient to have the following piece of notation to state our
result.  %Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}. 

In the next definition, $0<q<1$ will usually be the edge probability of the
random graph under consideration, $m_0$~will be the `size lower bound' as
in~\eqref{eq:H_is_large_enough}, and~$\alpha$, $\epsilon$, $\sigma$,
$\sigma'$, $\mu$, $\nu$, and~$\epsilon'$ will be small positive constants.

\begin{definition}[$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$]
  \label{def:1-sided_nbhd_lemma2_rgs}
  Given a graph~$G$, we say that property
  $\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ holds for~$G$
  if the following statement is true: suppose~$H=(U,W;F)\subset G$ is a
  bipartite subgraph of~$G$ and~$W=W'\cup W''$ is a partition of~$W$ for which
  the following assertions hold:
  \begin{enumerate}
  \item[(1)]$|U|=m_1$, $|W|=m_2$, where~$m_1$, $m_2\geq m_0$,
    and~$|F|\geq\alpha e(G[U,W])$,
  \item[(2)]$H=(U,W;F)$ is an $\epsilon'$-regular bipartite graph with respect
    to density~$q$,
  \item[(3)]$m_2'=|W'|\geq\nu m_2$ and $m_2''=|W''|\geq\nu m_2$.
  \end{enumerate}
  Then, putting~$p=e(H)/|U||W|=|F|/m_1m_2$ and~$H'=H[U,W']$
  and~$H''=H[U,W'']$, we have that for at least $(1-\mu)m_2'$ vertices~$w'\in
  W'$ the following assertion holds:
  \begin{enumerate}
  \item[(4)]if~$\tU=\Gamma_{H'}(w')=\Gamma_H(w')$
    and~$H(w')=H''[\tU,W'']=H[\tU,W'']$, then 
    \begin{enumerate}
    \item[(\textit{i})]$d_{H'}(w')=|\tU|\sim_{\sigma'}d_1=pm_1$,
    \item[(\textit{ii})]$\rho(w')=e(H(w'))/|\tU||W''|\sim_\sigma p$,
    \item[(\textit{iii})]$H(w')$ is $(\epsilon,\rho(w'))$-regular. 
    \end{enumerate}
  \end{enumerate}
\end{definition}

\begin{remark}
  \label{rem:wishy_washy}
  It may be worth noting that having
  property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ above
  is essentially equivalent to \textit{not} containing subgraphs isomorphic to
  members of the family in~\eqref{eq:H_fam_def}.  Given that this family is
  thin {\rm(\textsl{see Remark~\ref{rem:1-sided-thin-remark}})},
  Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs} below follows from calculations
  similar to the ones in Lemma~\ref{lem:Furedi}.
\end{remark}

\begin{theorem}[One-sided neighbourhood lemma, r.gs version]
  \label{cor:1-sided_nbhd_lemma2_rgs}
  Let~$0<q=q(n)<1$ and~$m_0=m_0(n)$ be such that
  \begin{equation}
    \label{eq:p_lbd_1-sided}
    q^3m_0\gg\log n
    \quad\text{and}\quad
    q^2m_0\gg(\log n)^4.
  \end{equation}
  Then, for all~$\alpha>0$, $\epsilon>0$, $\sigma>0$, $0<\sigma'<1$, $\mu>0$
  and~$\nu>0$, there is~$\epsilon'>0$ such that almost every~$G=G(n,q)$
  satisfies
  property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$. 
\end{theorem}

\subsubsection{A two-sided neighbourhood lemma}
\label{sec:2-sided-rgs}
In this section, we state a `two-sided' version of
Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.  Recall that in
property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ (see
Definition~\ref{def:1-sided_nbhd_lemma2_rgs}), we consider the
graph~$H(w')=H[\tU,W'']$, induced in~$H$ between~$W''$ and the
neighbourhood~$\tU=\Gamma_H(w')$ of the vertices~$w'\in W'$ in~$H=(U,W;F)$,
where~$W=W'\cup W''$ is some fixed partition of~$W$.

We are now interested in considering the bipartite graphs that are induced
between \textit{two} neighbourhoods in~$H$, namely, the
neighbourhoods~$\tU=\Gamma_H(w')$ ($w'\in W'$) as before and the
neighbourhoods~$\tW=\Gamma_H(u')$, where~$u'\in U'$ and~$U=U'\cup U''$ is some
fixed partition of~$U$ (for technical reasons, we shall in fact consider the
`restricted' neighbourhoods~$\Gamma_H(w')\cap U''$ and~$\Gamma_H(u')\cap
W''$).  To make this precise, we introduce
property~$\cN_2(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$, a
property whose definition follows closely the definition of
property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ (see
Definition~\ref{def:1-sided_nbhd_lemma2_rgs}).

In Definition~\ref{def:2-sided_nbhd_lemma2_rgs} below, the reader may think
of~$0<q<1$ as the edge probability of a random graph under consideration.  The
quantity~$m_0$ is the `size lower bound' as in~\eqref{eq:H_is_large_enough},
and~$\alpha$, $\epsilon$, $\sigma$, $\sigma'$, $\mu$, $\nu$, and~$\epsilon'$
are small positive constants.

\begin{definition}[$\cN_2(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$] 
  \label{def:2-sided_nbhd_lemma2_rgs}
  Given a graph~$G$, we say that property
  $\cN_2(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ holds
  for~$G$ if the following statement is true: suppose~$H=(U,W;F)\subset G$ is
  a bipartite subgraph of~$G$ and
  \begin{equation}
    \label{eq:2-sided_nbhd_lemma_partitions}
    U=U'\cup U''\quad\text{and}\quad W=W'\cup W'' 
  \end{equation}
  are partitions of~$U$ and~$W$ for which the following assertions hold:
  \begin{enumerate}
  \item[(1)]$|U|=m_1$, $|W|=m_2$, where~$m_1$, $m_2\geq m_0$,
    and~$|F|\geq\alpha e(G[U,W])$,
  \item[(2)]$H=(U,W;F)$ is an $\epsilon'$-regular bipartite graph with respect
    to density~$q$,
  \item[(3)]
    \begin{enumerate}
    \item[(\textit{a})]$m_1'=|U'|\geq\nu m_1$ and $m_1''=|U''|\geq\nu m_1$, 
    \item[(\textit{b})]$m_2'=|W'|\geq\nu m_2$ and $m_2''=|W''|\geq\nu m_2$.
    \end{enumerate}
  \end{enumerate}
  Put~$p=e(H)/|U||W|=|F|/m_1m_2$.  Moreover, for each pair of vertices~$u'\in
  U'$ and~$w'\in W'$ , let
  \begin{equation}
    \label{eq:2-sided_nbhd_lemma_the_induced_graph}
    H(u',w')=H[\Gamma_H(w')\cap U'',\Gamma_H(u')\cap W'']
  \end{equation}
  be the bipartite graph induced between the `restricted'
  neighbourhoods~$\Gamma_H(w')\cap U''$ and~$\Gamma_H(u')\cap W''$ of~$w'$
  and~$u'$.  Then, for at least~$(1-\mu)m_1'$ vertices~$u'\in U'$ and for at
  least~$(1-\mu)m_2'$ vertices~$w'\in W'$, the following assertion holds:
  \begin{enumerate}
  \item[(4)]let~$\tU=\Gamma_H(w')\cap U''$ and~$\tW=\Gamma_H(u')\cap W''$.
    Then
    \begin{enumerate}
    \item[(\textit{i})]$|\tU|\sim_{\sigma'}d_1''=pm_1''$ and
      $|\tW|\sim_{\sigma'}d_2''=pm_2''$, 
    \item[(\textit{ii})]$\rho(H(u',w'))=e(H(u',w'))/|\tU||\tW|\sim_\sigma p$,
    \item[(\textit{iii})]$H(u',w')$ is $(\epsilon,\rho(H(u',w')))$-regular.  
    \end{enumerate}
  \end{enumerate}
\end{definition}

We are now able to state our two-sided neighbourhood lemma for random graphs.

\begin{theorem}[Two-sided neighbourhood lemma, r.gs version]
  \label{cor:2-sided_nbhd_lemma2_rgs}
  Let~$0<q=q(n)<1$ and~$m_0=m_0(n)$ be such that
  \begin{equation}
    \label{eq:p_lbd_2-sided}
    q^3m_0\gg\log n
    \quad\text{and}\quad
    q^2m_0\gg(\log n)^4.
  \end{equation}
  Then, for all~$\alpha>0$, $\epsilon>0$, $\sigma>0$, $0<\sigma'<1$, $\mu>0$
  and~$\nu>0$, there is~$\epsilon'>0$ such that almost every~$G=G(n,q)$
  satisfies
  property~$\cN_2(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$. 
\end{theorem}

We shall prove Theorem~\ref{cor:2-sided_nbhd_lemma2_rgs}
in~\cite{kohayakawa00:_regul_ii}.  

\subsubsection{Proof of the one-sided neighbourhood lemma, auxiliary version}
\label{sec:pfof_1-sided}
Our aim in this section is to prove Lemmas~\ref{lem:1-sided_nbhd_lemma}
and~\ref{lem:exceptional_bd}.  We start with a technical but simple lemma.
Suppose~$B=(U,W;E)$ is a bipartite graph satisfying~(I) from
Section~\ref{sec:induced_subgraphs}.  Suppose further that
\begin{enumerate}
  \item[(\textit{i})]property~$\D(U,W;\eta,\epsilon)$ holds, 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    that is, 
%    for all~$\tU\subset U$ with~$|\tU|\geq\epsilon|U|$, we have 
%    \begin{equation}
%      \label{eq:D(U,W;eta,epsilon)}
%      \big|e(\tU,W)-p|\tU||W|\big|\leq\eta p|\tU||W|;
%    \end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \item[(\textit{ii})]for all~$\bU\subset U$ such that~$|\bU|\geq d/(\log
    m)^3$, we have
      \begin{equation}
        e(\bU,W)\leq Cp|\bU||W|, 
      \end{equation}
      where~$d$ and~$m$ are as in~(III)(\textit{b}).
\end{enumerate}
We would then like to say that, with extremely high probability, a
$d_1'$-set~$U'\subset U$, where~$d_1'\sim_{\sigma'}d_1$, chosen uniformly at
random from all such sets, is such that
\begin{enumerate} 
  \item[(\textit{iii})]$p'={e(U',W)/|U'||W|}\sim_\sigma p$, and
  \item[(\textit{iv})]$\D(U',W;\eta',\epsilon')$ holds, 
\end{enumerate}
where~$\sigma>0$, $\eta'>0$, and~$\epsilon'>0$ are small constants.  To be
more precise, we have the following lemma.

\begin{lemma}
  \label{lem:D_is_hereditary}
  For all~$\beta>0$, $\eta'>0$, $\epsilon'>0$, $\sigma>0$, $0<\sigma'<1$,
  and~$C\geq1$, there exist~$\eta>0$ and~$\epsilon>0$ such that, if
  {\rm(\textit{i})} and {\rm(\textit{ii})} hold and~$d_1'\sim_{\sigma'}d_1$,
  then the number of $d_1'$-sets~$U'\subset U$ failing
  either~{\rm(\textit{iii})} or~{\rm(\textit{iv})} is
  \begin{equation} 
    \label{eq:D_is_hereditary_upbd}
    \leq\beta^{d_1'}{m_1\choose d_1'}.
  \end{equation}
\end{lemma}

The fairly straightforward proof of Lemma~\ref{lem:D_is_hereditary}, which is
based on the hypergeometric tail lemma (Lemma~\ref{lem:hypergeometric}), is
postponed to the end of Section~\ref{sec:pfof_1-sided}.

\begin{proof}[Proof of Lemma~\ref{lem:1-sided_nbhd_lemma}]
  The proof will be based on Lemmas~\ref{lem:2-day_lemma}, \ref{lem:mx_lemma},
  and~\ref{lem:D_is_hereditary}.  Let~$\beta$, $\epsilon$, $\sigma$,
  $\sigma'$, $\Cchub$, and~$\Cecb$ as in the statement of
  Lemma~\ref{lem:1-sided_nbhd_lemma} be given.  Invoke
  Lemma~\ref{lem:mx_lemma} with
  parameters~$\epsilon(\ref{lem:mx_lemma})=\epsilon$
  and~$C(\ref{lem:mx_lemma})=\Cchub$.  Lemma~\ref{lem:mx_lemma} then gives us
  a constant~$\delta(\ref{lem:mx_lemma})>0$.  Here we are following the
  convention of Remark~\ref{rem:parameterized_constans}.  Since we have a
  stronger statement for smaller values of~$\sigma$, we may and shall assume
  that
  \begin{equation}
    \label{eq:sigma_small}
    \sigma\leq{1\over7}\delta(\ref{lem:mx_lemma}).
  \end{equation}
  
  We now invoke Lemma~\ref{lem:2-day_lemma}
  with~$\alpha(\ref{lem:2-day_lemma})=\delta(\ref{lem:mx_lemma})$
  and~$\beta(\ref{lem:2-day_lemma})=\beta/2$, and obtain the
  constant~$\eta_0(\ref{lem:2-day_lemma})$.  Let us now apply
  Lemma~\ref{lem:D_is_hereditary} to
  constants~$\beta(\ref{lem:D_is_hereditary})=\beta/2$,
  $\eta'(\ref{lem:D_is_hereditary})=\delta(\ref{lem:mx_lemma})$,
  $\epsilon'(\ref{lem:D_is_hereditary})=\epsilon$,
  $\sigma(\ref{lem:D_is_hereditary})=\sigma$,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%_2=\min\{\sigma,\sigma_1\}$,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  $\sigma'(\ref{lem:D_is_hereditary})=\sigma'$,
  and~$C(\ref{lem:D_is_hereditary})=\Cecb$.  Lemma~\ref{lem:D_is_hereditary}
  then gives us constants~$\eta(\ref{lem:D_is_hereditary})>0$
  and~$\epsilon(\ref{lem:D_is_hereditary})>0$.
  
  Finally, we put $\epsilon'=\epsilon(\ref{lem:D_is_hereditary})$,
  \begin{equation}
    \label{eq:Lemma_14_delta_def}
    \delta=\min\left\{{1\over7}\delta(\ref{lem:mx_lemma}),
      \eta_0(\ref{lem:2-day_lemma})\right\},
  \end{equation}
  $\eta_0=\eta(\ref{lem:D_is_hereditary})$,
  and~$\eta_1=\delta(\ref{lem:mx_lemma})$.

  \begin{claim}
    \label{claim:lem:1-sided_nbhd_lemma}
    This choice for~$\epsilon'$, $\delta$, $\eta_i$ $(i\in\{0,1\})$ will do in
    Lemma~\ref{lem:1-sided_nbhd_lemma}.
  \end{claim}
  \begin{proof}
    To prove this claim, we select, uniformly at random, a
    $d_1'$-set~$U'\subset U$, and estimate the probability that
    either~(\textit{a}) or~(\textit{b}) in the definition
    of~$\cI(d_1';\sigma,\epsilon)$ fails to hold, assuming
    that~$U'\notin\cE(d_1';\eta_1,\Cchub)$.  We start by invoking
    Lemma~\ref{lem:D_is_hereditary}.  Condition~(II)(\textit{a}) tells us that
    property~$\D(U,W;\eta_0,\epsilon')
    =\D(U,W;\eta(\ref{lem:D_is_hereditary}),\epsilon(\ref{lem:D_is_hereditary}))$
    holds, and hence condition~(\textit{i}) in Lemma~\ref{lem:D_is_hereditary}
    holds.  Moreover, condition~(III)(\textit{b}) tells us that
    hypothesis~(\textit{ii}) of Lemma~\ref{lem:D_is_hereditary} is satisfied
    with~$C(\ref{lem:D_is_hereditary})=\Cecb$.
    Lemma~\ref{lem:D_is_hereditary} then tells us that, with probability
    $\geq1-\betaexcept(\ref{lem:D_is_hereditary})^{d_1'}\geq1-(1/2)\beta^{d_1'}$,
    we have that
    \begin{equation}
      \label{eq:D_condition_11}
      \text{property
      }\D(U',W;\eta'(\ref{lem:D_is_hereditary}),\epsilon'(\ref{lem:D_is_hereditary})) 
      =\D(U',W;\delta(\ref{lem:mx_lemma}),\epsilon)\text{ holds,}
    \end{equation}
    and that
    \begin{equation}
      \label{eq:rho_sigma2}
      \rho={e(B[U',W])\over|U'||W|}\sim_{\sigma(\ref{lem:D_is_hereditary})}p.
    \end{equation}
    Note that~\eqref{eq:rho_sigma2} means that
    \begin{equation}
      \label{eq:rho_sigma2b}
      \rho\sim_\sigma p,
    \end{equation}
    since~$\sigma(\ref{lem:D_is_hereditary})=\sigma$.  We assume henceforth
    that~\eqref{eq:D_condition_11}--\eqref{eq:rho_sigma2b} hold.  Recall
    now that, by~(II)(\textit{b}),
    \begin{equation}
      \label{eq:have_PC_delta}
      \text{property $\PC(U,W;\delta)$ holds.}
    \end{equation}
    Consider
    \begin{equation}
      \label{eq:F=F(U,W;delta)}
      F=F(U,W;\delta)\subset{U\choose2},
    \end{equation}
    and think of~$F$ as a graph on the vertex set~$U$; in particular,
    write~$F[U']$ for the graph induced by~$U'$.  In view of the fact
    that~$\delta\leq\eta_0(\ref{lem:2-day_lemma})$
    (see~\eqref{eq:Lemma_14_delta_def}) and~\eqref{eq:have_PC_delta}, an
    application of Lemma~\ref{lem:2-day_lemma} gives that
    \begin{equation}
      \label{eq:prob_dev}
      \PP\(e(F[U'])\geq\alpha(\ref{lem:2-day_lemma}){d_1'\choose2}\)
      \leq\beta(\ref{lem:2-day_lemma})^{d_1'}
      \leq{1\over2}\beta^{d_1'}.
    \end{equation}
    We claim that if
    \begin{equation}
      \label{eq:F[U']_small}
      e(F[U'])<\alpha(\ref{lem:2-day_lemma}){d_1'\choose2}
    \end{equation}
    holds, then
    \begin{equation}
      \label{eq:have_PC(U',W;delta12)}
      \text{property $\PC(U',W;\delta(\ref{lem:mx_lemma}))$ holds.}
    \end{equation}
    For convenience, put~$\delta'=\delta/7$.  In order to verify this claim,
    we first assert that
    \begin{equation}
      \label{eq:Lemma14_windows}
      (1-\delta(\ref{lem:mx_lemma}))\rho^2m_2
      \leq(1-\delta')p^2m_2
      \leq(1+\delta')p^2m_2
      \leq(1+\delta(\ref{lem:mx_lemma}))\rho^2m_2.
    \end{equation}
    Let us check~\eqref{eq:Lemma14_windows}.  Using~\eqref{eq:rho_sigma2b}, we
    deduce that 
    \begin{multline}
      \label{eq:lower_end}
      (1-\delta(\ref{lem:mx_lemma}))\rho^2
      \leq(1-\delta(\ref{lem:mx_lemma}))(1+\sigma)^2p^2
      \leq(1-\delta(\ref{lem:mx_lemma}))(1+3\sigma)p^2\\
      \leq(1-\delta(\ref{lem:mx_lemma})+3\sigma)p^2
      \leq\(1-{4\over7}\delta(\ref{lem:mx_lemma})\)p^2
      \leq(1-\delta')p^2.
    \end{multline}
    Moreover, again using~\eqref{eq:rho_sigma2b}, we have
    \begin{multline}
      \label{eq:upper_end}
      (1+\delta')p^2\leq(1+\delta'){\rho^2\over(1-\sigma)^2}
      \leq(1+\delta')(1+3\sigma)\rho^2\\
      =(1+\delta'+3\sigma+3\sigma\delta')\rho^2
      \leq(1+\delta'+6\sigma)\rho^2
      \leq(1+\delta(\ref{lem:mx_lemma}))\rho^2.
    \end{multline}
    Inequalities~\eqref{eq:lower_end} and~\eqref{eq:upper_end} show
    that~\eqref{eq:Lemma14_windows} does indeed hold.  Now,
    \eqref{eq:Lemma14_windows} implies that
    \begin{equation}
      \label{eq:F_contanment}
      F(U',W;\delta(\ref{lem:mx_lemma}))
      \subset F(U,W;\delta')
      \subset F(U,W;\delta).
    \end{equation}
    However, \eqref{eq:F=F(U,W;delta)}, \eqref{eq:F[U']_small},
    and~\eqref{eq:F_contanment} implies that
    \begin{equation}
      \label{eq:F(U',W;delta12)_small}
      |F(U',W;\delta(\ref{lem:mx_lemma}))|
      \leq\alpha(\ref{lem:2-day_lemma}){d_1'\choose2}.
    \end{equation}
    Since~$\alpha(\ref{lem:2-day_lemma})=\delta(\ref{lem:mx_lemma})$,
    relation~\eqref{eq:F(U',W;delta12)_small} means that
    \begin{equation}
      \label{eq:PC_condition_11}
      \text{property $\PC(U',W;\delta(\ref{lem:mx_lemma}))$ holds.}
    \end{equation}
    Since~\eqref{eq:F[U']_small} holds with probability
    $\geq1-\beta(\ref{lem:2-day_lemma})^{d_1'}\geq1-(1/2)\beta^{d_1'}$
    (see~\eqref{eq:prob_dev}), we have that~\eqref{eq:PC_condition_11} holds
    with this probability.  We assume from now on
    that~\eqref{eq:PC_condition_11} does hold.  We have to show that~$B[U',W]$
    is $(\epsilon,\rho)$-regular.

    Since we are assuming that~$U'\notin\cE(d_1';\eta_1,\Cchub)$, we know that
    \begin{equation}
      \label{eq:ChUB_condition_11}
      \ChUB(U',W;\eta_1,\Cchub)
      =\ChUB(U',W;\delta(\ref{lem:mx_lemma}),C(\ref{lem:mx_lemma}))
      \text{ holds.}
    \end{equation}
    We now observe that
    \begin{equation}
      \label{eq:size_lbd}
      \rho|U'|
      \geq{1\over\epsilon(\ref{lem:mx_lemma})\delta(\ref{lem:mx_lemma})}
      ={1\over\epsilon\delta(\ref{lem:mx_lemma})},
    \end{equation}
    since we assume that~$|U|=m_1\gg1/p^2$.  We are now in position to apply
    Lemma~\ref{lem:mx_lemma} to~$B[U',W]$.  Because
    of~\eqref{eq:D_condition_11}, \eqref{eq:PC_condition_11},
    \eqref{eq:ChUB_condition_11}, and~\eqref{eq:size_lbd}, by
    Lemma~\ref{lem:mx_lemma} we have that~$B[U',W]$ is
    $(\epsilon,\rho)$-regular.
    This finishes the proof of Claim~\ref{claim:lem:1-sided_nbhd_lemma}.
  \end{proof}

  The proof of Lemma~\ref{lem:1-sided_nbhd_lemma} is complete.
\end{proof}

Half of the proof of Lemma~\ref{lem:exceptional_bd} is in fact contained in
the proof of Lemma~\ref{lem:1-sided_nbhd_lemma} above.

\begin{proof}[Proof of Lemma~\ref{lem:exceptional_bd}]
  The proof of this lemma will be based on Lemma~\ref{lem:D_is_hereditary}.
  Let constants~$\betaexcept$, $Q$, $\sigma$, $\sigma'$, $\eta_1$, and~$\Cecb$
  as in the statement of Lemma~\ref{lem:exceptional_bd} be given.  We invoke
  Lemma~\ref{lem:D_is_hereditary} with
  constants~$\beta(\ref{lem:D_is_hereditary})=\betaexcept$,
  $\eta'(\ref{lem:D_is_hereditary})=\epsilon'(\ref{lem:D_is_hereditary})=1$
  (in fact, we do not care about conclusion~(\textit{iv}) in
  Lemma~\ref{lem:D_is_hereditary}),
  $\sigma(\ref{lem:D_is_hereditary})=\sigma$,
  $\sigma'(\ref{lem:D_is_hereditary})=\sigma'$,
  and~$C(\ref{lem:D_is_hereditary})=\Cecb$.  Then,
  Lemma~\ref{lem:D_is_hereditary} gives us
  constants~$\eta(\ref{lem:D_is_hereditary})>0$
  and~$\epsilon(\ref{lem:D_is_hereditary})>0$.  We
  let~$\eta_0=\eta(\ref{lem:D_is_hereditary})$
  and~$\epsilon'=\epsilon(\ref{lem:D_is_hereditary})$, and claim that this
  choice for~$\eta_0$ and~$\epsilon'$ will do in
  Lemma~\ref{lem:exceptional_bd}.
  
  Thus, let~$B=(U,W;E)$ be as in the statement of
  Lemma~\ref{lem:exceptional_bd} and, as in the proof
  Lemma~\ref{lem:1-sided_nbhd_lemma}, let~$U'$ be a random $d_1'$-subset
  of~$U$.  We shall estimate the probability that
  \begin{equation}
    \label{eq:exceptional_ChUB}
    \ChUB(U',W;\eta_1,Q/(1-\sigma)^2)
  \end{equation}
  fails.
  
  By conditions~(I), (II)(\textit{a}), (III)(\textit{b}), and the choice of
  the constants, we may deduce from Lemma~\ref{lem:D_is_hereditary} that
  inequality~\eqref{eq:rho_sigma2} holds with
  probability~$1-\betaexcept^{d_1'}$.  We now assume
  that~\eqref{eq:rho_sigma2} holds and we prove
  that~\eqref{eq:exceptional_ChUB} follows.  Clearly, this suffices to prove
  Lemma~\ref{lem:exceptional_bd}.
  
  To verify~\eqref{eq:exceptional_ChUB}, we let~$F'\subset{U'\choose2}$
  with~$|F'|\leq\eta_1{|U'|\choose2}$ be fixed.  Then,
  by~(III)(\textit{a$'$}), we have
  \begin{equation}
    \label{eq:ChUB_exceptional}
    \sum_{\{x,y\}\in F'}d_W^B(x,y)
    \leq Q\eta_1 p^2|U'|^2|W|
    \leq{Q\over(1-\sigma)^2}\eta_1\rho^2|U'|^2|W|,
  \end{equation}
  where we used that~$p\leq\rho/(1-\sigma)$, which follows
  from~\eqref{eq:rho_sigma2}.  Thus~\eqref{eq:exceptional_ChUB} does follow
  and Lemma~\ref{lem:exceptional_bd} is proved.  
\end{proof}

\begin{proof}[Proof of Lemma~\ref{lem:D_is_hereditary}]
  Let~$\beta>0$, $\eta'>0$, $\epsilon'>0$, $\sigma>0$, $0<\sigma'<1$,
  and~$C\geq1$ be given.  It turns out that it will be convenient to have that 
  \begin{equation}
    \label{eq:pf_D_her_sigma_condition}
    \sigma\leq{1\over3}\eta'.
  \end{equation}
  One easily sees that we may assume~\eqref{eq:pf_D_her_sigma_condition},
  since the smaller~$\sigma$ is, the stronger is the result that we get.
  Also, we set
  \begin{equation}
    \label{eq:pf_D_her_eta''}
    \eta''={1\over3}\eta'.
  \end{equation}
  Let~$\alpha>0$ and~$\eta>0$ be small enough so that we have
  \begin{equation}
    \label{eq:pf_D_her1}
    \eta+C\alpha\leq\sigma\quad\text{and}\quad
    \eta+{C\alpha\over\epsilon'}\leq\eta''.  
  \end{equation}
  Let now~$U'\subset U$ be a set of cardinality~$d_1'$ chosen uniformly at
  random, where~$d_1'\sim_{\sigma'}d_1$.
  Let~$\epsilon=\epsilon(\alpha,\beta)>0$ be small enough so that if~$X\subset
  U$ is a fixed set such that~$|X|\leq2\epsilon|U|$, then
  \begin{equation}
    \label{eq:pf_D_her2}
    \PP(|U'\cap X|>\alpha|U'|)<\beta^{d_1'}.
  \end{equation}
  The existence of such a constant~$\epsilon>0$ follows from
  Lemma~\ref{lem:hypergeometric}.  We claim that this choice of~$\eta$
  and~$\epsilon$ will do.  To verify this claim, suppose
  conditions~(\textit{i}) and~(\textit{ii}) hold for our bipartite
  graph~$B=(U,W;E)$.

  Let us now consider property~(\textit{iii}).  Let
  \begin{equation}
    \label{eq:pf_D_her_B_def}
    X=\left\{x\in U\:\big|d_W^B(x)-p|W|\big|>\eta p|W|\right\}.
  \end{equation}
  Because of property~$D(U,W;\eta,\epsilon)$, we have that~$|X|<2\epsilon|U|$.
  Because of our choice of~$\epsilon>0$, we know that~\eqref{eq:pf_D_her2}
  holds.  In the remainder of the proof, we show that
  properties~(\textit{iii}) and~(\textit{iv}) do hold if we have
  \begin{equation}
    \label{eq:pf_D_her_small_inter}
    |U'\cap X|\leq\alpha|U'|.
  \end{equation}
  In view of~\eqref{eq:pf_D_her2}, this will complete the proof of
  Lemma~\ref{lem:D_is_hereditary}.  Thus, let us assume
  that~\eqref{eq:pf_D_her_small_inter} holds.  To estimate~$e(U',W)$, observe
  that 
  \begin{equation}
    \label{eq:pf_D_her_e(U',W)_split}
    e(U',W)=e(U'\setminus X,W)+e(U'\cap X,W).
  \end{equation}
  We have 
  \begin{equation}
    \label{eq:pf_D_her_e(U'-X,W)}
    e(U'\setminus X,W)\leq(1+\eta)p|U'\setminus X||W|
    \leq(1+\eta)p|U'||W|.
  \end{equation}
  On the other hand, extending~$U'\cap X$ to a set~$\bU\subset U$ of
  cardinality~$\alpha|U'|\geq d/(\log m)^3$ arbitrarily, we have,
  by condition~(\textit{ii}) in the set-up for
  Lemma~\ref{lem:D_is_hereditary}, that 
  \begin{equation}
    \label{eq:pf_D_her_e(U'capX,W)}
    e(U'\cap X,W)\leq e(\bU,W)\leq Cp\alpha|U'||W|.
  \end{equation}
  Putting together~\eqref{eq:pf_D_her_e(U',W)_split},
  \eqref{eq:pf_D_her_e(U'-X,W)}, and~\eqref{eq:pf_D_her_e(U'capX,W)},
  we have
  \begin{multline}
    \label{eq:pf_D_her_e(U',W)_upbd}
    e(U',W)\leq(1+\eta)p|U'||W|+C\alpha p|U'||W|\\
    \leq(1+\eta+C\alpha)p|U'||W|\leq(1+\sigma)p|U'||W|,
  \end{multline}
  where we used~\eqref{eq:pf_D_her1} for the last inequality.  Also,
  we have
  \begin{multline}
    \label{eq:pf_D_her_e(U',W)_lwbd}
    e(U',W)\geq e(U'\setminus X,W)
    \geq(1-\eta)p|U'\setminus X||W|
    \geq(1-\eta)(1-\alpha)p|U'||W|\\
    \geq(1-(\eta+\alpha))p|U'||W|
    \geq(1-\sigma)p|U'||W|,
  \end{multline}
  where again we used~\eqref{eq:pf_D_her1}.
  Inequalities~\eqref{eq:pf_D_her_e(U',W)_upbd}
  and~\eqref{eq:pf_D_her_e(U',W)_lwbd} mean that~$e(U',W)\sim_\sigma
  p|U'||W|$.  Thus we have deduced that condition~(\textit{iii}) of our lemma
  holds if~\eqref{eq:pf_D_her_small_inter} is verified.
  
  Let us now show that~(\textit{iv}) is also implied
  by~\eqref{eq:pf_D_her_small_inter}.  Let~$\tU'\subset U'$
  with~$|\tU'|\geq\epsilon'|U'|$ be given.  Then
  \begin{equation}
    \label{eq:pf_D_her_tU'capX_upbd}
    |\tU'\cap X|\leq|U'\cap X|\leq\alpha|U'|
    \leq{\alpha\over\epsilon'}|\tU'|.
  \end{equation}
  We have
  \begin{equation}
    \label{eq:pf_D_her_e(tU'-X,W)_upbd}
    e(\tU'\setminus X,W)\leq(1+\eta)p|\tU'\setminus X||W|
    \leq(1+\eta)p|\tU'||W|.
  \end{equation}
  Moreover,
  \begin{equation}
    \label{eq:pf_D_her_e(tU'capX,W)_upbd}
    e(\tU'\cap X,W)\leq e(\bU,W)\leq Cp|\bU||W|
    \leq Cp{\alpha\over\epsilon'}|\tU'||W|,
  \end{equation}
  where~$\bU\subset U'$ is an arbitrary subset of~$U'$ with~$\tU'\cap
  X\subset\bU$ and~$|\bU|=\alpha|U'|\geq d/(\log m)^3$.  Note that the
  last inequality in~\eqref{eq:pf_D_her_e(tU'capX,W)_upbd} follows
  from~$|\bU|=\alpha|U'|\leq(\alpha/\epsilon')|\tU'|$.
  Summing~\eqref{eq:pf_D_her_e(tU'-X,W)_upbd}
  and~\eqref{eq:pf_D_her_e(tU'capX,W)_upbd}, we obtain
  \begin{multline}
    \label{eq:pf_D_her_e(tU',W)_upbd}
    e(\tU',W)
    \leq(1+\eta)p|\tU'||W|+{C\alpha\over\epsilon'}p|\tU'||W|\\
    \leq\(1+\eta+{C\alpha\over\epsilon'}\)p|\tU'||W|
    \leq(1+\eta'')p|\tU'||W|,
  \end{multline}
  where for the last inequality we used~\eqref{eq:pf_D_her1}.  Finally,
  using~\eqref{eq:pf_D_her_tU'capX_upbd} and~\eqref{eq:pf_D_her1}, we observe
  that
  \begin{multline}
    \label{eq:pf_D_her_e(tU',W)_lwbd}
    e(\tU',W)\geq e(\tU'\setminus X,W)
    \geq(1-\eta)p|\tU'\setminus X||W|
    \geq(1-\eta)\(1-{\alpha\over\epsilon'}\)p|\tU'||W|\\
    \geq\(1-\eta-{\alpha\over\epsilon'}\)p|\tU'||W|
    \geq(1-\eta'')p|\tU'||W|.
  \end{multline}
  Inequalities~\eqref{eq:pf_D_her_e(tU',W)_upbd}
  and~\eqref{eq:pf_D_her_e(tU',W)_lwbd} mean that  
  \begin{equation}
    \label{eq:pf_D_her_e(tU',W)_conclusion}
    e(\tU',W)\sim_{\eta''}p|\tU'||W|.
  \end{equation}
  Using that
  \begin{equation}
    \label{eq:p'_and_p}
    p'={e(U',W)\over|U'||W|}\sim_\sigma p,
  \end{equation}
  which we already know follows from~\eqref{eq:pf_D_her_small_inter}, we
  shall deduce from~\eqref{eq:pf_D_her_e(tU',W)_conclusion} that
  \begin{equation}
    \label{eq:pf_D_her_fin}
    e(\tU',W)\sim_{\eta'}p'|\tU'||W|.
  \end{equation}
  Note that, then, we shall have proved that condition~(\textit{iv}) does
  follow from~\eqref{eq:pf_D_her_small_inter}, and hence the proof
  Lemma~\ref{lem:D_is_hereditary} will be complete.  Let us
  prove~\eqref{eq:pf_D_her_fin}.

  We claim that
  \begin{equation}
    \label{eq:Lemma18_window}
    (1-\eta')p'\leq(1-\eta'')p\leq(1+\eta'')p\leq(1+\eta')p',
  \end{equation}
  and note that this claim suffices to show that~\eqref{eq:pf_D_her_fin}
  follows from~\eqref{eq:pf_D_her_e(tU',W)_conclusion}.  Let us therefore
  check~\eqref{eq:Lemma18_window}.  Since~\eqref{eq:p'_and_p} holds and we
  have~\eqref{eq:pf_D_her_sigma_condition} and~\eqref{eq:pf_D_her_eta''}, we
  see that
  \begin{equation}
    \label{eq:Lemma_18_lower_end}
    (1-\eta')p'\leq(1-\eta')(1+\sigma)p
    \leq(1-\eta'+\sigma)p\leq(1-\eta'')p.
  \end{equation}
  Moreover, again by~\eqref{eq:p'_and_p}, \eqref{eq:pf_D_her_sigma_condition},
  and~\eqref{eq:pf_D_her_eta''} we have that
  \begin{multline}
    \label{eq:Lemma_18_upper_end}
    (1+\eta')p'\geq(1+\eta')(1-\sigma)p
    =(1+\eta'-\sigma-\sigma\eta')p\\
    \geq(1+\eta'-2\sigma)p
    \geq(1+\eta'')p.
  \end{multline}
  Inequalities~\eqref{eq:Lemma_18_lower_end} and~\eqref{eq:Lemma_18_upper_end}
  show that~\eqref{eq:Lemma18_window} does indeed hold.  The proof of
  Lemma~\ref{lem:D_is_hereditary} is complete.
\end{proof}

\subsubsection{Proof of the one-sided neighbourhood lemma, counting version}
\label{sec:1-sided_nbhd_lemma_cv}
The proof of Lemma~\ref{lem:1-sided_nbhd_lemma2} will be based on repeated
applications of Lemma~\ref{lem:1-sided_nbhd_lemma}.

\begin{proof}[Proof of Lemma~\ref{lem:1-sided_nbhd_lemma2}]
  Let~$\beta$, $\epsilon$, $\mu$, $\nu$, $\sigma$, $\sigma'$, $\Cchub$,
  and~$\Cecb$ as in the statement of the lemma be given.
  Let~$\beta_0>0$ be a constant such that 
  \begin{equation}
    \label{eq:beta_0_def}
    \beta_0^{(1/2)\nu\mu(1-\sigma')^3}
    \leq{1\over2}\beta.
  \end{equation}
  For later reference, observe that
  \begin{equation}
    \label{eq:beta_0_prop}
    \beta_0^{(1/2)\mu(1-\sigma')^2}
    \leq{1\over2}\beta,
  \end{equation}
  since~$\nu(1-\sigma')\leq1$.  Let
  \begin{equation}
    \label{eq:beta(14)_betaexcept_def}
    \beta(\ref{lem:1-sided_nbhd_lemma})=\betaexcept={1\over2}\beta_0.
  \end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Let~$\beta(\ref{lem:1-sided_nbhd_lemma})>0$ be a constant such that
%  \begin{equation}
%    \label{eq:beta(13)_prop}
%    \beta(\ref{lem:1-sided_nbhd_lemma})^{(1/2)\nu\mu(1-\sigma')^3}
%    \leq{1\over3}\beta.
%  \end{equation}
%  For later reference, observe that
%  \begin{equation}
%    \label{eq:beta(13)_prop2}
%    \beta(\ref{lem:1-sided_nbhd_lemma})^{(1/2)\mu(1-\sigma')^2}
%    \leq{1\over3}\beta,
%  \end{equation}
%  since~$\nu(1-\sigma')\leq1$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Let also $\epsilon(\ref{lem:1-sided_nbhd_lemma})=\epsilon$,
  $\sigma(\ref{lem:1-sided_nbhd_lemma})=\sigma$,
  $\sigma'(\ref{lem:1-sided_nbhd_lemma})=\sigma'$,
  $\Cchub(\ref{lem:1-sided_nbhd_lemma})=\Cchub$, and
  $\Cecb(\ref{lem:1-sided_nbhd_lemma})=\Cecb$.
  Lemma~\ref{lem:1-sided_nbhd_lemma} then asserts the existence of the
  constants $\epsilon'=\epsilon'(\ref{lem:1-sided_nbhd_lemma})$,
  $\delta=\delta(\ref{lem:1-sided_nbhd_lemma})$,
  $\eta_0=\eta_0(\ref{lem:1-sided_nbhd_lemma})$, and
  $\eta_1=\eta_1(\ref{lem:1-sided_nbhd_lemma})$.  We claim that these
  constants~$\epsilon'$, $\delta$, $\eta_0$, and~$\eta_1$ will do in
  Lemma~\ref{lem:1-sided_nbhd_lemma2}.  We now proceed to prove this claim.
  
  Recall that we aim at estimating the number of pairs~$(B,B')$ of graphs
  satisfying the properties given in the statement of
  Lemma~\ref{lem:1-sided_nbhd_lemma2}.  We estimate the number of graphs~$B$
  in such pairs~$(B,B')$ by the trivial bound
  \begin{equation}
    \label{eq:number_of_B}
    \leq{m_1m_2\choose T}.
  \end{equation}
  We now fix a graph~$B$ and generate the graphs~$B'$ for which $(B,B')$ is a
  valid pair by randomly selecting the neighbourhood sets of the
  vertices~$w'\in W'$ in~$U$.  To be more precise, pick first a partition
  $\bfd=(f_i)_{1\leq i\leq m'}$ of~$T'$, and suppose
  that~$d(w_i')=d_U^{B'}(w_i')=f_i$, where~$W'=\{w_1',\dots,w_{m'}'\}$.
  Consider only the degree sequences~$\bfd$ such that for at least~$m'/2$
  indices~$i$ we have~$f_i\sim_{\sigma'}d_1=pm_1$
  (cf.~\eqref{eq:degree_cond}).  We now generate~$B'$ by picking an
  element~$(\tU_i)_{1\leq i\leq m'}$ from
  \begin{equation}
    \label{eq:random_space}
    \prod_{1\leq i\leq m'}{U\choose f_i}
  \end{equation}
  uniformly at random, and letting~$\Gamma_{B'}(w_i')=\tU_i$ for all~$1\leq
  i\leq m'$.  We now apply Lemma~\ref{lem:1-sided_nbhd_lemma} and
  property~(III)(\textit{a$''$}).  Given a vertex~$w_i'\in W'$, note
  that~$w_i'$ will be a $(\epsilon(\ref{lem:1-sided_nbhd_lemma}),
  \sigma(\ref{lem:1-sided_nbhd_lemma}),
  \sigma'(\ref{lem:1-sided_nbhd_lemma});B,B')$-bad vertex if and only
  if~$f_i\sim_{\sigma'}d_1=pm_1$ and its
  neighbourhood~$\tU_i=\Gamma_{B'}(w_i')\subset{U\choose f_i}$ satisfies
  \begin{equation}
    \label{eq:bad_neighbourhood}
    \tU_i\in\cI(f_i;\sigma(\ref{lem:1-sided_nbhd_lemma}),
    \epsilon(\ref{lem:1-sided_nbhd_lemma}))
    \cup\cE(f_i;\eta_1(\ref{lem:1-sided_nbhd_lemma}),
    \Cchub(\ref{lem:1-sided_nbhd_lemma}))
  \end{equation}
  (cf.~\eqref{eq:alternative_bad_def}).  Thus, assuming
  that~$f_i\sim_{\sigma'}d_1=pm_1$, the number of choices for the
  neighbourhood of~$w_i'$ that makes~$w_i'$ a
  $(\epsilon(\ref{lem:1-sided_nbhd_lemma}),
  \sigma(\ref{lem:1-sided_nbhd_lemma}),
  \sigma'(\ref{lem:1-sided_nbhd_lemma});B,B')$-bad vertex is, by
  Lemma~\ref{lem:1-sided_nbhd_lemma} and property~(III)(\textit{a$''$}),
  \begin{multline}
    \label{eq:number_of_bad_choices}
    \big|\cI(f_i;\sigma(\ref{lem:1-sided_nbhd_lemma}),
    \epsilon(\ref{lem:1-sided_nbhd_lemma}))
    \cup\cE(f_i;\eta_1(\ref{lem:1-sided_nbhd_lemma}),
    \Cchub(\ref{lem:1-sided_nbhd_lemma}))\big|\\
    \leq\beta(\ref{lem:1-sided_nbhd_lemma})^{f_i}{U\choose f_i}
    +\betaexcept^{f_i}{U\choose f_i}
    =\(\beta(\ref{lem:1-sided_nbhd_lemma})^{f_i}
    +\betaexcept^{f_i}\){U\choose f_i}.
  \end{multline}
  Since we choose an element from~\eqref{eq:random_space} uniformly at random
  to generate~$B'$ and the events that~$w_i'$ should be
  $(\epsilon(\ref{lem:1-sided_nbhd_lemma}),
  \sigma(\ref{lem:1-sided_nbhd_lemma}),
  \sigma'(\ref{lem:1-sided_nbhd_lemma});B,B')$-bad ($1\leq i\leq m'$) are
  independent, we see that the probability that~(IV) holds is at most
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd}
    \sum_{W''}\prod_{w_i'\in W''}
    \(\beta(\ref{lem:1-sided_nbhd_lemma})^{f_i}+\betaexcept^{f_i}\)
    \leq\sum_{W''}\prod_{w_i'\in W''}\beta_0^{f_i},
%    \sum_{W''}\prod_{w_i'\in W''}\beta(\ref{lem:1-sided_nbhd_lemma})^{f_i},
  \end{equation}
  where the sum is over all
  \begin{equation}
    \label{eq:W''_def}
    W''\subset W^*=\{w_i'\:f_i\sim_{\sigma'}d_1=pm_1\}
  \end{equation}
  with~$|W''|\geq\mu m'$.  Now note that 
  \begin{equation}
    \label{eq:d_1_m'_lwbd}
    d_1m'=pm_1m'={p\over p'}p'm_1m'\geq{1\over1+\sigma'}T'\geq(1-\sigma')T',
  \end{equation}
  since~\eqref{eq:p'_sim_p_condition} holds.  Therefore, 
  we have that~\eqref{eq:pf_1-sided_prob_upbd} is 
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd2}
    \leq2^{m'}\beta_0^{\mu(1-\sigma')d_1m'}
    \leq2^{m'}\beta_0^{\mu(1-\sigma')^2T'}.
  \end{equation}
  Summing over all possible degree sequences~$\bfd=(f_i)_{1\leq i\leq m'}$, we
  deduce that the number of graphs~$B'$ valid for a fixed graph~$B$ is
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd3}
    \leq{T'+m'-1\choose m'-1}2^{m'}
    \beta_0^{\mu(1-\sigma')^2T'}
    {m_1m'\choose T'}.
  \end{equation}
  However, we deduce from~\eqref{eq:m'_lwbd} and~\eqref{eq:p'_sim_p_condition}
  that
  \begin{equation}
    \label{eq:T'_lwbd}
    T'\geq(1-\sigma')T{m_1m'\over m_1m_2}\geq\nu(1-\sigma')T.
  \end{equation}
  Inequality~\eqref{eq:T'_lwbd} implies that the quantity
  in~\eqref{eq:pf_1-sided_prob_upbd3} is
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd4a}
    \leq{T'+m'-1\choose m'-1}2^{m'}
    \beta_0^{(1/2)\nu\mu(1-\sigma')^3T+(1/2)\mu(1-\sigma')^2T'}
    {m_1m'\choose T'}.
  \end{equation}
  Recalling~\eqref{eq:beta_0_def} and~\eqref{eq:beta_0_prop}, we see
  that the quantity in~\eqref{eq:pf_1-sided_prob_upbd4a} is 
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd4b}
    \leq(T'+1)^{m'-1}2^{m'-(T+T')}\beta^{T+T'}{m_1m'\choose T'}.
  \end{equation}
  We now recall that we are assuming that~$\tT=T+T'\gg m'\log m'$.
  Using~\eqref{eq:T'_lwbd}, we deduce that~$T'\gg m'\log m'$.  Hence
  \begin{equation}
    \label{eq:superlog}
    (T'+1)^{m'-1}2^{-T'/2}\ll1. 
  \end{equation}
  Similarly, 
  \begin{equation}
    \label{eq:superlog2}
    2^{m'-T'/2}\ll1.
  \end{equation}
  From~\eqref{eq:superlog} and~\eqref{eq:superlog2}, it follows that the
  quantity in~\eqref{eq:pf_1-sided_prob_upbd4b} is
  \begin{equation}
    \label{eq:pf_1-sided_prob_upbd4c}
    \leq\beta^{T+T'}{m_1m'\choose T'}.
  \end{equation}
  The result now follows from~\eqref{eq:number_of_B}
  and~\eqref{eq:pf_1-sided_prob_upbd3}, \eqref{eq:pf_1-sided_prob_upbd4a},
  \eqref{eq:pf_1-sided_prob_upbd4b}, and~\eqref{eq:pf_1-sided_prob_upbd4c}.
\end{proof}

\subsubsection{Proof of the one-sided neighbourhood lemma, r.gs version}
\label{sec:1-sided_nbhd_lemma_rgs}
The proof of Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs} is based on
Lemmas~\ref{lem:ECB_rgs}, \ref{lem:ChUB_rgs}, \ref{lem:exceptional_bd},
and~\ref{lem:1-sided_nbhd_lemma2}, and on Theorem~\ref{cor:pcl}.

\begin{proof}[Proof of Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}]
  Let~$\alpha$, $\epsilon$, $\sigma$, $\sigma'$, $\mu$ and~$\nu$ be as in the
  statement of the theorem.  We now invoke
  Lemma~\ref{lem:1-sided_nbhd_lemma2} with the following constants.  We
  let~$\beta(\ref{lem:1-sided_nbhd_lemma2})=\alpha/8\e$,
  $\epsilon(\ref{lem:1-sided_nbhd_lemma2})=\epsilon$,
  $\mu(\ref{lem:1-sided_nbhd_lemma2})=\mu/2$, 
  $\nu(\ref{lem:1-sided_nbhd_lemma2})=\nu$,
  $\sigma(\ref{lem:1-sided_nbhd_lemma2})=\sigma$,
  $\sigma'(\ref{lem:1-sided_nbhd_lemma2})=\sigma'$,
  $\Cchub(\ref{lem:1-sided_nbhd_lemma2})=20/\alpha^2(1-\sigma)^2$,
  and~$\Cecb(\ref{lem:1-sided_nbhd_lemma2})=3/\alpha$.  Then,
  Lemma~\ref{lem:1-sided_nbhd_lemma2} gives us positive 
  constants~$\betaexcept(\ref{lem:1-sided_nbhd_lemma2})$,
  $\epsilon'(\ref{lem:1-sided_nbhd_lemma2})$,
  $\delta(\ref{lem:1-sided_nbhd_lemma2})$,
  $\eta_0(\ref{lem:1-sided_nbhd_lemma2})$,
  and~$\eta_1(\ref{lem:1-sided_nbhd_lemma2})$.
  
  We now invoke Lemma~\ref{lem:exceptional_bd} with the following constants.
  We let~$\betaexcept(\ref{lem:exceptional_bd})
  =\betaexcept(\ref{lem:1-sided_nbhd_lemma2})$,
  $Q(\ref{lem:exceptional_bd})=20/\alpha^2$,
  $\sigma(\ref{lem:exceptional_bd})=\sigma$,
  $\sigma'(\ref{lem:exceptional_bd})=\sigma'$,
  $\eta_1(\ref{lem:exceptional_bd})=\eta_1(\ref{lem:1-sided_nbhd_lemma2})$, 
  and~$\Cecb(\ref{lem:exceptional_bd})=3/\alpha$.  Then
  Lemma~\ref{lem:exceptional_bd} gives us
  constants~$\epsilon'(\ref{lem:exceptional_bd})$
  and~$\eta_0(\ref{lem:exceptional_bd})$. 
  
  We now let~$\alpha(\ref{cor:pcl})=\alpha/4$ and
  $\gamma(\ref{cor:pcl})=\delta(\ref{lem:1-sided_nbhd_lemma2})$ and invoke
  Theorem~\ref{cor:pcl}, which gives us~$\epsilon(\ref{cor:pcl})>0$.
  Finally, we let~$\delta(\ref{lem:ChUB_rgs})
  =\eta_1(\ref{lem:exceptional_bd})=\eta_1(\ref{lem:1-sided_nbhd_lemma2})$ and
  let
  \begin{equation}
    \label{eq:epsilon'_def}
    \epsilon'=\min\left\{{1\over6}\alpha,
      \epsilon'(\ref{lem:1-sided_nbhd_lemma2}),
      \epsilon'(\ref{lem:exceptional_bd}),
      {1\over4}\nu,
      {1\over6}\alpha\eta_0(\ref{lem:exceptional_bd}),
      {1\over6}\alpha\eta_0(\ref{lem:1-sided_nbhd_lemma2}),
      {1\over2}\nu\epsilon(\ref{cor:pcl}),
      {1\over5}\alpha\sigma',
      {1\over4}\nu\mu
    \right\}
  \end{equation}
  We claim that this choice for~$\epsilon'$ will do for
  Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.  The remainder of this proof is
  dedicated to the proof of this claim.
  
  We first give four almost sure properties of our random graph~$G=G(n,q)$.
  Lemma~\ref{lem:ECB_rgs} tells us that we may assume that~$G=G(n,q)$
  satisfies the following property.
  \begin{enumerate}
  \item[($P_1$)]let~$m^{(1)}=m^{(1)}(n)$ be a function with~$qm^{(1)}\gg\log
    n$.  Then, if~$A$ and~$B$ are two disjoint vertex sets with~$|A|$,
    $|B|\geq m^{(1)}$, we have~$e(G[A,B])\sim q|A||B|$.
  \end{enumerate}
  Lemma~\ref{lem:ChUB_rgs} tells us that we may assume that the following
  property holds for~$G=G(n,q)$. 
  \begin{enumerate}
  \item[($P_2$)]let~$m^{(2)}=m^{(2)}(n)$ be a function with~$q^2m^{(2)}\gg\log
    n$.  Then, for any~$A$, $B\subset V(G)$ with~$A\cap B=\emptyset$
    and~$|A|$, $|B|\geq m^{(2)}$, we have that for any~$F\subset{A\choose2}$
    with~$|F|\leq\delta(\ref{lem:ChUB_rgs}){|A|\choose2}
    =\eta_1(\ref{lem:exceptional_bd}){|A|\choose2}$ we have 
    \begin{equation}
      \label{eq:rgs_ChUB}
      \sum_{\{x,y\}\in
        F}d_B^G(x,y)\leq2\delta(\ref{lem:ChUB_rgs})q^2|A|^2|B|
        =2\eta_1(\ref{lem:exceptional_bd})q^2|A|^2|B|. 
    \end{equation}
  \end{enumerate}
  By Theorem~\ref{cor:pcl}, we may assume that the following property
  holds in~$G=G(n,q)$. 
  \begin{enumerate}
  \item[($P_3$)]let~$m^{(3)}=m^{(3)}(n)$ be a function with~$q^2m^{(2)}\gg(\log
    n)^4$.  For any graph~$H\subset G$ such
    that~$e(H[A,B])\geq\alpha(\ref{cor:pcl})e(G[A,B])$, if~$H[A,B]$ is
    $(\epsilon(\ref{cor:pcl}),q)$-regular, then
    property~$\PC(A,B;\gamma(\ref{cor:pcl}))$ holds. 
  \end{enumerate}
  Finally, by Lemma~\ref{lem:1-sided_nbhd_lemma2}, we may assume that the
  following holds for~$G=G(n,q)$.
  \begin{enumerate}
  \item[($P_4$)]Let~$m^{(4)}=m^{(4)}(n)$ be such that~$qm^{(4)}\gg\log n$.
    Consider pairs of bipartite graphs~$(B,B')$ as in
    Lemma~\ref{lem:1-sided_nbhd_lemma2}.  Thus, we consider pairs~$(B,B')$ for
    which the properties, notation and definitions given in (I),
    (II)(\textit{a}) and~(\textit{b}), (III)(\textit{a$''$}) and~(\textit{b}),
    and~(IV), and the compatibility
    conditions~\eqref{eq:m'_lwbd}--\eqref{eq:degree_cond} in
    Sections~\ref{sec:induced_subgraphs} and~\ref{sec:1-sided-couting} apply.
    Suppose further that~$m_1=|U|\geq m^{(4)}$, $m_2+m'=|W|+|W'|\geq m^{(4)}$,
    and that~$p=e(B)/|U||W|\geq(\alpha/2)q$.  Then, $G$ contains no isomorphic
    copy of the pair~$(B,B')$ as a subgraph.
  \end{enumerate}

  \begin{remark}
    \label{rem:P_4_proof}
    We shall not give a proof for the fact that~$(P_4)$ does indeed hold
    almost surely for~$G=G(n,q)$.  Such a proof, based on estimating the
    expected number of copies of such pairs~$(B,B')$ in~$G=G(n,q)$ using
    Lemma~\ref{lem:1-sided_nbhd_lemma2}, is similar to the proofs of
    Lemma~\ref{lem:Furedi} and Theorem~\ref{cor:pcl} {\rm(\textsl{see also
        Remark~\ref{rem:1-sided-thin-remark}})}.
  \end{remark}

  We now state and prove a deterministic statement that will complete the
  proof of Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.  

  \begin{claim}
    \label{claim:1-sided_nbhd_lemma2_rgs}
    If~$G$ satisfies properties $(P_1)$--$(P_4)$ above, then
    property
    $$
    \cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')
    $$
    holds.  
  \end{claim}
  \begin{proof}
    To prove this claim, we assume that~$H=(U,W;F)\subset G$ is a bipartite
    subgraph of~$G$ and~$W=W'\cup W''$ is a partition of~$W$ for which
    conditions~(1)--(3) in the definition
    of~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ are
    satisfied.  Our aim is to show that, then, for $\geq(1-\mu)m_2'$ vertices
    $w'\in W'$, assertion~(4) in that definition holds.  For convenience, we
    state explicitly the hypotheses and the conclusion that we wish to derive.
    We are assuming that
    \begin{enumerate}
    \item[(1)]$|U|=m_1$, $|W|=m_2$, where~$m_1$, $m_2\geq m_0$,
      and~$|F|\geq\alpha e(G[U,W])$,
    \item[(2)]$H=(U,W;F)$ is an $\epsilon'$-regular bipartite graph with respect
      to density~$q$,
    \item[(3)]$m_2'=|W'|\geq\nu m_2$ and $m_2''=|W''|\geq\nu m_2$.
    \end{enumerate}
    Then, putting~$p=e(H)/|U||W|=|F|/m_1m_2$ and~$H'=H[U,W']$
    and~$H''=H[U,W'']$, we wish to show that for~$\geq(1-\mu)m_2'$
    vertices~$w'\in W'$ the following assertion holds:
    \begin{enumerate}
    \item[(4)]if~$\tU=\Gamma_{H'}(w')$ and~$H(w')=H''[\tU,W'']=H[\tU,W'']$, then
      \begin{enumerate}
      \item[(\textit{i})]$d_{H'}(w')=|\tU|\sim_{\sigma'}d_1=pm_1$,
      \item[(\textit{ii})]$\rho(w')=e(H(w'))/|\tU||W''|\sim_\sigma p$,
      \item[(\textit{iii})]$H(w')$ is $(\epsilon,\rho(w'))$-regular. 
      \end{enumerate}
    \end{enumerate}
    Let us prove~(4).

    Since~$|F|\geq\alpha e(G[U,W])$ and property~$(P_1)$ holds, we
    have~$p=e(H)/|U||W|=|F|/m_1m_2\gtrsim\alpha q$.  We assume from now on
    that 
    \begin{equation}
      \label{eq:p_lbd_1-sided_rgs}
      p\geq{1\over2}\alpha q.
    \end{equation}
       
    Let us now relate the densities $p'=e(H')/|U||W'|$
    and~$p''=e(H'')/|U||W''|$ of $H'$ and~$H''$ to that of~$H$.  From the
    $(\epsilon',q)$-regularity of~$H$ and the fact that~$\epsilon'\leq\nu$
    (see~\eqref{eq:epsilon'_def}), we may deduce that
    \begin{equation}
      \label{eq:p'_and_p_1-sided_rgs}
      \left|{e(U,W')\over q|U||W'|}-{e(U,W)\over q|U||W|}\right|
      =\left|{p'\over q}-{p\over q}\right|\leq\epsilon'.
    \end{equation}
    Inequalities~\eqref{eq:p'_and_p_1-sided_rgs}
    and~\eqref{eq:p_lbd_1-sided_rgs} gives that
    \begin{equation}
      \label{eq:p'_and_p_1-sided_rgs2}
      |p'-p|\leq\epsilon'q\leq{2\epsilon'\over\alpha}p, 
    \end{equation}
    that is, $p'\sim_{2\epsilon'/\alpha}p$.  A similar argument holds
    for~$p''$, and hence we have
    \begin{equation}
      \label{eq:p'_sim_p}
      p'\sim_{2\epsilon'/\alpha}p\qquad\text{and}
      \qquad p''\sim_{2\epsilon'/\alpha}p.
    \end{equation}
    The inequalities in~\eqref{eq:p'_sim_p} give that 
    \begin{equation}
      \label{eq:p'_sim_p''}
      p'\sim_{5\epsilon'/\alpha}p''.
    \end{equation}
        
    Let us now check that conditions~(I), (II)(\textit{a}) and~(\textit{b}),
    (III)(\textit{a$''$}) and~(\textit{b}) hold for~$H''$ with the
    constants~$\eta_0(\ref{lem:1-sided_nbhd_lemma2})$,
    $\epsilon'(\ref{lem:1-sided_nbhd_lemma2})$,
    $\delta(\ref{lem:1-sided_nbhd_lemma2})$,
    $\sigma'(\ref{lem:1-sided_nbhd_lemma2})$,
    $\eta_1(\ref{lem:1-sided_nbhd_lemma2})$,
    $\Cchub(\ref{lem:1-sided_nbhd_lemma2})$,
    $\betaexcept(\ref{lem:1-sided_nbhd_lemma2})$,
    and~$\Cecb(\ref{lem:1-sided_nbhd_lemma2})$.  For clarity, we state these
    conditions explicitly.
    \begin{enumerate}
      \item[(I)]$|U|=m_1$, $|W''|=m_2''$, $T''=e(H'')$, $p''=T''/m_1m_2''$,
        $d_1''=p''m_1$, and~$d_2''=p''m_2''$. 
      \item[(II)]
        \begin{enumerate}
        \item[(\textit{a})]Property $\D(U,W'';
          \eta_0(\ref{lem:1-sided_nbhd_lemma2}),
          \epsilon'(\ref{lem:1-sided_nbhd_lemma2}))$ holds.
        \item[(\textit{b})]Property $\PC(U,W'';
          \delta(\ref{lem:1-sided_nbhd_lemma2}))$ holds.
          \end{enumerate}  
      \item[(III)]
      \begin{enumerate}
      \item[(\textit{a$''$})]For
        all~$d\sim_{\sigma'(\ref{lem:1-sided_nbhd_lemma2})}d_1''=p''m_1$, we
        have 
      \begin{equation}
        \label{eq:cE_up_bd_1-sided_rgs}
        |\cE(d;\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
        \Cchub(\ref{lem:1-sided_nbhd_lemma2}))|
        \leq\betaexcept(\ref{lem:1-sided_nbhd_lemma2})^d{m_1\choose d}.
      \end{equation}
      Notice that~$\cE(d;\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
      \Cchub(\ref{lem:1-sided_nbhd_lemma2}))$ is the family of sets~$U'\subset
      U$ with~$|U'|=d$ for which
      property~$\ChUB(U',W'';\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
      \Cchub(\ref{lem:1-sided_nbhd_lemma2}))$ fails.
    \item[(\textit{b})]Property
      $\ECB(U,W'';\Cecb(\ref{lem:1-sided_nbhd_lemma2}))$ holds.  In
      particular, if~$\bU\subset U$ is such that~$|\bU|\geq d''/(\log m'')^3$,
      then
        \begin{equation}
          e(\bU,W)\leq\Cecb(\ref{lem:1-sided_nbhd_lemma2})p''|\bU||W''|,
        \end{equation}
        where $d''=\min\{d_1'',d_2''\}$ and~$m''=m_+''=\max\{m_1,m_2''\}$.  
      \end{enumerate}
    \end{enumerate}

    We now verify the assertions above one by one.
    
    \assertion{\rm(I)}$|U|=m_1$, $|W''|=m_2''$, $T''=e(H'')$, $p''=T''/m_1m_2''$,
        $d_1''=p''m_1$, and~$d_2''=p''m_2''$. 
    \endassertion
    \casebody
    Assertion~(I) only introduces some notation, so there is nothing to
    verify. 
    \endcasebody
    
    \assertion{\rm(II)(\textit{a})}Property $\D(U,W'';
    \eta_0(\ref{lem:1-sided_nbhd_lemma2}),
    \epsilon'(\ref{lem:1-sided_nbhd_lemma2}))$ holds.
    \endassertion
    \casebody
    Let~$U'\subset U$ be such
    that~$|U'|\geq\epsilon'(\ref{lem:1-sided_nbhd_lemma2})|U|$.  From the fact  
    that~$\epsilon'\leq\epsilon'(\ref{lem:1-sided_nbhd_lemma2})$
    and~$\epsilon'\leq\nu$ (see~\eqref{eq:epsilon'_def}), and the fact that we
    are assuming that~$H$ is $(\epsilon',q)$-regular (see assumption~(2)), we
    have 
    \begin{equation}
      \label{eq:1-sided_rgs_1}
      \left|{e(U',W'')\over q|U'||W''|}-{e(U,W)\over q|U||W|}\right|
      \leq\epsilon'
    \end{equation}
    and
    \begin{equation}
      \label{eq:1-sided_rgs_2}
      \left|{e(U,W'')\over q|U||W''|}-{e(U,W)\over q|U||W|}\right|
      \leq\epsilon'.
    \end{equation}
    Therefore, recalling that~$p''/q=e(U,W'')/q|U||W''|$, we have
    from~\eqref{eq:1-sided_rgs_1} and~\eqref{eq:1-sided_rgs_2} that
    \begin{equation}
      \label{eq:1-sided_rgs_3}
      \left|{e(U',W'')\over q|U'||W''|}-{p''\over q}\right|
      \leq2\epsilon'.
    \end{equation}
    Inequality~\eqref{eq:1-sided_rgs_3} implies that
    \begin{multline}
      \label{eq:q-sided_rgs_3}
      \big|e(U',W'')-p''|U'||W''|\big|\leq2\epsilon'q|U'||W''|
      \leq{4\over\alpha}\epsilon'p|U'||W''|\\
      \leq{4\over\alpha}\epsilon'{p''\over1-2\epsilon'/\alpha}|U'||W''|
      \leq\eta_0(\ref{lem:1-sided_nbhd_lemma2})p''|U'||W''|,
    \end{multline}
    where we used inequalities~\eqref{eq:p_lbd_1-sided_rgs},
    \eqref{eq:p'_sim_p}, and~\eqref{eq:epsilon'_def}.
    \endcasebody
    
    \assertion{\rm(II)(\textit{b})}Property $\PC(U,W'';
    \delta(\ref{lem:1-sided_nbhd_lemma2}))$ holds. 
    \endassertion
    \casebody
    We start by observing that~$|U|$, $|W''|\gg q^2(\log n)^4$ and hence
    property~$(P_3)$ above applies to these sets.  We have, by~$(P_1)$,
    \eqref{eq:p_lbd_1-sided_rgs}, and~\eqref{eq:p'_sim_p}, 
    \begin{multline}
      e(U,W'')=p''|U||W''|\sim{p''\over q}e(G[U,W''])\\
      \geq\(1-{2\epsilon'\over\alpha}\){p\over q}e(G[U,W''])
      \geq\(1-{2\epsilon'\over\alpha}\){\alpha\over2}e(G[U,W'']).
    \end{multline}
    Using that~$\epsilon'\leq\alpha/6$ (see~\eqref{eq:epsilon'_def}), we have
    that 
    \begin{equation}
      \label{eq:e(U,W'')_lbd_1-sided_rgs}
      e(U,W'')\gtrsim{1\over3}\alpha e(G[U,W'']).
    \end{equation}
    Recalling that~$\alpha(\ref{cor:pcl})=\alpha/4$, we may conclude
    from~\eqref{eq:e(U,W'')_lbd_1-sided_rgs} that
    \begin{equation}
      \label{eq:eq:e(U,W'')_lbd_1-sided_rgs2}
      e(U,W'')\geq\alpha(\ref{cor:pcl})e(G[U,W'']).  
    \end{equation}
    Since~$H[U,W]$ is $(\epsilon',q)$-regular and~$|W''|\geq\nu|W|$, we know
    that~$H[U,W'']$ is $(2\epsilon'/\nu,q)$-regular.
    Since~$\epsilon'\leq\nu\epsilon(\ref{cor:pcl})/2$, we deduce
    that~$H[U,W'']$ is $(\epsilon(\ref{cor:pcl}),q)$-regular.  We may then
    apply~$(P_3)$ to conclude that property~$\PC(U,W'';\gamma(\ref{cor:pcl}))
    =\PC(U,W'';\delta(\ref{lem:1-sided_nbhd_lemma2}))$ holds.
    \endcasebody

    It will be convenient to prove (III)(\textit{b}) before
    (III)(\textit{a$''$}). 
    
    \assertion{\rm(III)(\textit{b})}Property
    $\ECB(U,W'';\Cecb(\ref{lem:1-sided_nbhd_lemma2}))$ holds.
    \endassertion
    \casebody
    Recall~\eqref{eq:p_lbd_1-sided_rgs} and~\eqref{eq:p'_sim_p}, and observe
    that we therefore have
    \begin{equation}
      \label{eq:p''_in_terms_of_q}
      p''\geq{1\over2}\(1-{2\epsilon'\over\alpha}\)\alpha q.
    \end{equation}
    Since~$m_1\geq m_0$ and~$m_2''\geq\nu m_2\geq\nu m_0$ (recall
    assumptions~(1) and~(3)), we have from~\eqref{eq:p''_in_terms_of_q} that 
    \begin{equation}
      \label{eq:d''_from_below}
      d''=\min\{d_1'',d_2''\}=\min\{p''m_1,p''m_2''\}
      \geq{1\over2}\(1-{2\epsilon'\over\alpha}\)\alpha\nu qm_0.
    \end{equation}
    Put~$m''=m_+''=\max\{m_1,m_2''\}$, and observe that
    \begin{equation}
      \label{eq:P_1_hypothesis}
      q\times{d''\over(\log m'')^3}
      \geq{1\over2}\(1-{2\epsilon'\over\alpha}\)\alpha\nu
      {q^2m_0\over(\log n)^3}\gg\log n,
    \end{equation}
    where for the last inequality we used the second inequality
    in~\eqref{eq:p_lbd_1-sided}.  Hence property~$(P_1)$ tells us that, for
    any two disjoint sets~$A$ and~$B$ with~$|A|$, $|B|\geq d''/(\log m'')^3$,
    we have
    \begin{equation}
      \label{eq:ECB_bd2_1-sided_rgs}
      e(H[A,B])\leq e(G[A,B])\sim
      q|A||B|\leq{2\over\alpha}p|A||B|,
    \end{equation}
    where we again used~\eqref{eq:p_lbd_1-sided_rgs}.  However,
    since~$\Cecb(\ref{lem:1-sided_nbhd_lemma2})=3/\alpha$, we have
    from~\eqref{eq:ECB_bd2_1-sided_rgs} that
    \begin{equation}
      \label{eq:eq:ECB_bd2_1-sided_rgs2}
      e(H[A,B])\leq\Cecb(\ref{lem:1-sided_nbhd_lemma2})p|A||B|. 
    \end{equation}
    Therefore~$\ECB(U,W'';\Cecb(\ref{lem:1-sided_nbhd_lemma2}))$ does
    hold. 
    \endcasebody

    \assertion{\rm(III)(\textit{a$''$})}For
    all~$d\sim_{\sigma'(\ref{lem:1-sided_nbhd_lemma2})}d_1''=p''m_1$, we have
      \begin{equation}
        \label{eq:cE_up_bd_1-sided_rgs2}
        |\cE(d;\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
        \Cchub(\ref{lem:1-sided_nbhd_lemma2}))|
        \leq\betaexcept(\ref{lem:1-sided_nbhd_lemma2})^d{m_1\choose d}.  
      \end{equation}
    \endassertion
    \casebody
    Recall that~$\cE(d;\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
    \Cchub(\ref{lem:1-sided_nbhd_lemma2}))$ is the family of sets~$U'\subset
    U$ with~$|U'|=d$ for which
    property~$\ChUB(U',W'';\eta_1(\ref{lem:1-sided_nbhd_lemma2}),
    \Cchub(\ref{lem:1-sided_nbhd_lemma2}))$ fails.
    
    We shall use Lemma~\ref{lem:exceptional_bd}.  Note that hypotheses~(I),
    (II)(\textit{a}), and~(III)(\textit{b}) of that lemma have already been
    verified for~$H''$.  We now check condition~(III)(\textit{a$'$})
    for~$H''$, making use of~$(P_2)$.  Let~$U'\subset U$
    with~$d=|U'|\sim_{\sigma'(\ref{lem:exceptional_bd})}d_1''$ be fixed.
    Using the first inequality in~\eqref{eq:p_lbd_1-sided},
    \eqref{eq:p_lbd_1-sided_rgs}, and~\eqref{eq:p'_sim_p}, we have
    \begin{equation}
      \label{eq:U'_size_1-sided_rgs}
      |U'|\sim_{\sigma'(\ref{lem:exceptional_bd})}d_1''=p''m_1
      \sim_{2\epsilon'/\alpha}pm_1\geq{1\over2}\alpha qm_1
      \geq{1\over2}\alpha qm_0
      \gg q^{-2}\log n.
    \end{equation}
    We also have~$|W''|\gg q^{-2}\log n$ with lots of room to spare, since
    \begin{equation}
      \label{eq:W''_size_1-sided_rgs}
      |W''|\geq\nu|W|=\nu m_2\geq\nu m_0\gg q^{-3}\log n.
    \end{equation}
    Property~$(P_2)$ with~$A=U'$ and~$B=W''$ tells us that for
    any~$F\subset{U'\choose2}$
    with~$|F|\leq\delta(\ref{lem:ChUB_rgs}){|U'|\choose2}
    =\eta_1(\ref{lem:exceptional_bd}){|U'|\choose2}$ we have
    \begin{equation}
      \label{eq:rgs_ChUB_1-sided_rgs}
      \sum_{\{x,y\}\in F}d_B^G(x,y)
      \leq2\delta(\ref{lem:ChUB_rgs})q^2|U'|^2|W''|
      =2\eta_1(\ref{lem:exceptional_bd})q^2|U'|^2|W''|.
    \end{equation}
    The right-hand side of~\eqref{eq:rgs_ChUB_1-sided_rgs} is,
    by~\eqref{eq:p_lbd_1-sided_rgs} and~\eqref{eq:p'_sim_p},  
    \begin{multline}
      \label{eq:rgs_ChUB_1-sided_rgs2}
      \leq2\eta_1(\ref{lem:exceptional_bd})\(2p\over\alpha\)^2|U'|^2|W''|
      \leq{8\over\alpha^2}\(1\over1-2\epsilon'/\alpha\)^2
        \eta_1(\ref{lem:exceptional_bd})(p'')^2|U'|^2|W''|\\
      \leq Q(\ref{lem:exceptional_bd})
        \eta_1(\ref{lem:exceptional_bd})(p'')^2|U'|^2|W''|.
    \end{multline}
    Lemma~\ref{lem:exceptional_bd} then implies
    that~\eqref{eq:cE_up_bd_1-sided_rgs2} holds for
    all~$d\sim_{\sigma'(\ref{lem:1-sided_nbhd_lemma2})}d_1''=p''m_1$.  Here we
    use that Lemma~\ref{lem:exceptional_bd} was invoked with the `right'
    constants, namely, $\sigma'(\ref{lem:exceptional_bd})
    =\sigma'(\ref{lem:1-sided_nbhd_lemma2})=\sigma'$,
    $\betaexcept(\ref{lem:exceptional_bd})
    =\betaexcept(\ref{lem:1-sided_nbhd_lemma2})$,
    $\eta_1(\ref{lem:exceptional_bd})=\eta_1(\ref{lem:1-sided_nbhd_lemma2})$,
    and~$\Cchub(\ref{lem:1-sided_nbhd_lemma2})
    =Q(\ref{lem:exceptional_bd})/(1-\sigma)^2=20/\alpha^2(1-\sigma)^2$.
    \endcasebody
    
    We have thus checked that conditions~(I), (II)(\textit{a})
    and~(\textit{b}), (III)(\textit{a$''$}) and~(\textit{b}) hold for~$H''$.
    We now consider the `compatibility'
    conditions~\eqref{eq:m'_lwbd}--\eqref{eq:degree_cond} for~$H'=(U,W';F')$
    with respect to~$H''=(U,W'';F'')$.  Again for clarity, we state these
    compatibility conditions explicitly.
    
    The first condition states that
    \begin{equation}
      \label{eq:m'_lwbdB}
      m_2'\geq\nu(|W'|+|W''|)=\nu(m_2'+m_2'')=\nu m_2.  
    \end{equation}
    The second conditions is that 
    \begin{equation}
      \label{eq:p'_sim_p_conditionB}
      p'={e(H')\over m_1m_2'}
      \sim_{\sigma'(\ref{lem:1-sided_nbhd_lemma2})}
      p''={e(H'')\over m_1m_2''}. 
    \end{equation}
    The last condition is that 
    \begin{equation}
      \label{eq:degree_condB}
      \begin{split}
        &\text{for at least~$m_2'/2$ vertices~$w'\in W_2'$, we have }\\
        &\qquad
        d_{H'}(w')=|\Gamma_{H'}(w')|\sim_{\sigma'(\ref{lem:1-sided_nbhd_lemma2})}
        d_1''=p''m_1. 
      \end{split}
    \end{equation}

    \assertion{\rm(*)}The compatibility
    conditions~\eqref{eq:m'_lwbdB}--\eqref{eq:degree_condB} for~$H'=(U,W';F')$ 
    with respect to~$H''=(U,W'';F'')$ do hold.
    \endassertion
    \casebody
    We have as an assumption that~$|W'|=m_2'\geq\nu|W|=\nu m_2$, and
    hence~\eqref{eq:m'_lwbdB} is satisfied.  Let us now
    consider~\eqref{eq:p'_sim_p_conditionB}.
    Since~$\sigma'(\ref{lem:1-sided_nbhd_lemma2})\geq5\epsilon'/\alpha$
    (see~\eqref{eq:epsilon'_def}), relation~\eqref{eq:p'_sim_p''} tells us
    that~\eqref{eq:p'_sim_p_conditionB} holds.  We now
    verify~\eqref{eq:degree_condB}.

    Observe that the $(\epsilon',q)$-regularity of~$H$ implies that for
    $\geq(1-2\epsilon')m_2$ vertices $w\in W$ we have,
    by~\eqref{eq:p_lbd_1-sided_rgs}, 
    \begin{equation}
      \label{eq:deg_deviation}
      |d_H(w)-pm_1|\leq\epsilon'qm_1\leq\epsilon'\(2p\over\alpha\)m_1. 
    \end{equation}
    Inequality~\eqref{eq:deg_deviation} is equivalent
    to~$d_H(w)\sim_{2\epsilon'/\alpha}pm_1$.  This, coupled
    with~\eqref{eq:p'_sim_p}, implies that
    \begin{equation}
      \label{eq:degree_cond_applied}
      \begin{split}
        &\text{for at least~$(1-2\epsilon'/\nu)m_2'$
          vertices~$w'\in W'$,}\\
        &\qquad\text{we have }d_{H'}(w')\sim_{5\epsilon'/\alpha}d_1''=p''m_1.
      \end{split}
    \end{equation}
    Since~$\sigma'(\ref{lem:1-sided_nbhd_lemma2})\geq5\epsilon'/\alpha$
    and~$2\epsilon'/\nu\leq1/2$ (see~\eqref{eq:epsilon'_def}), the condition
    in~\eqref{eq:degree_condB} holds.  We have thus checked that~$H'$ is
    compatible with~$H''$.
    %
    \endcasebody
    
    We are now approaching the end of the proof of
    Claim~\ref{claim:1-sided_nbhd_lemma2_rgs}.  It is worth recalling that our
    aim is to prove assertions~(\textit{i}), (\textit{ii}), and~(\textit{iii})
    of~(4) in the definition of
    property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$,
    reproduced at the beginning of the proof of this claim.
    
    We have already observed that the $(\epsilon',q)$-regularity of~$H$
    implies that, for~$\geq(1-2\epsilon')m_2$ vertices~$w\in W$, we
    have~$d_H(w)\sim_{2\epsilon'/\alpha}d_1=pm_1$.  But then, in view of the
    fact that~$2\epsilon'/\nu\leq\mu/2$ (see~\eqref{eq:epsilon'_def})
    and~$2\epsilon'/\alpha\leq\sigma'$ (see~\eqref{eq:epsilon'_def}), this
    implies that for $\geq(1-\mu/2)m_2'$ vertices~$w'\in W'$ we have
    that~(4)(\textit{i}) holds.  We now consider properties~(4)(\textit{ii})
    and~(4)(\textit{iii}).  We invoke property~$(P_4)$.
    
    Since we know that the pair of compatible graphs~$(H'',H')$ satisfies
    conditions~(I), (II)(\textit{a}) and~(\textit{b}), (III)(\textit{a$''$})
    and~(\textit{b}), and we are assuming, according to~$(P_4)$, that~$G$
    contains no pair~$(B,B')$ satisfying all these conditions \textit{and}
    condition~(IV), we deduce that condition~(IV) must fail for~$(H'',H')$.
    In other words, the number of $(\epsilon(\ref{lem:1-sided_nbhd_lemma2}),
    \sigma(\ref{lem:1-sided_nbhd_lemma2}),
    \sigma'(\ref{lem:1-sided_nbhd_lemma2});H'',H')$-bad vertices is less
    than~$\mu(\ref{lem:1-sided_nbhd_lemma2})m_2'=(\mu/2)m_2'$.  Hence, for
    $\geq(1-\mu/2)m_2'$ vertices~$w'\in W'$,
    putting~$\tU=\tU(w')=\Gamma_{H''}(w')$, we have that
    \begin{itemize}
    \item[(\textit{a})]$\rho_{w'}=e(H''[\tU,W])/|\tU||W|
      \sim_{\sigma(\ref{lem:1-sided_nbhd_lemma2})}p=T/m_1m_2$ holds,  
      \item[(\textit{b})]$H''[\tU,W]$ is
        $(\epsilon(\ref{lem:1-sided_nbhd_lemma2}),\rho_{w'})$-regular, and   
      \item[(\textit{c})]$\tU\in\cE(|\tU|;
        \eta_1(\ref{lem:1-sided_nbhd_lemma2}),
        \Cchub(\ref{lem:1-sided_nbhd_lemma2}))$.
    \end{itemize}
    Now recall that~$\sigma(\ref{lem:1-sided_nbhd_lemma2})=\sigma$
    and~$\epsilon(\ref{lem:1-sided_nbhd_lemma2})=\epsilon$, and note
    that~(\textit{a}) above corresponds to~(4)(\textit{ii}) and
    that~(\textit{b}) above corresponds to~(4)(\textit{iii}).
    
    We conclude that for $\geq(1-\mu)m_2'$ vertices~$w'\in W'$ we have that
    properties~(\textit{i}), (\textit{ii}), and~(\textit{iii}) of~(4) in the
    definition of
    property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$
    hold (see Definition~\ref{def:1-sided_nbhd_lemma2_rgs}).  This finishes
    the proof of Claim~\ref{claim:1-sided_nbhd_lemma2_rgs}.
  \end{proof}
  The proof of Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs} is
  complete.
\end{proof}

\subsection{The $k$-tuple lemma for subgraphs of random graphs}
\label{sec:k-tuples_rgs}
Theorems~\ref{cor:pcl}, \ref{cor:mx_lemma_rgs},
and~\ref{cor:1-sided_nbhd_lemma2_rgs}, \textit{i.e.}, the pair condition
lemma, the the local condition lemma, and the one-sided neighbourhood lemma
(all of these in the r.gs version) imply a generalization of
Theorem~\ref{cor:pcl}.  This generalization is Theorem~\ref{cor:k-tuples_rgs}
below.

Let us remark in passing that we do not give a generalization of
Lemma~\ref{lem:pcl} that extends this lemma in the same direction that
Theorem~\ref{cor:k-tuples_rgs} extends Theorem~\ref{cor:pcl}; such a
generalization would be a result concerning the number certain `exceptional'
$\epsilon$-regular bipartite graphs.  The reason we omit this `counting
version' of Theorem~\ref{cor:k-tuples_rgs} is that it would be quite technical.  
Instead, we prove directly the random graphs result that is relevant in
applications.   

Roughly speaking, in this section, we aim at estimating the number of
$k$-tuples of vertices that have joint neighbourhoods of the wrong size in
sparse $\epsilon$-regular bipartite graphs that arise as subgraphs of random
graphs.

\subsubsection{The statement of the $k$-tuple lemma }
\label{sec:state_k-tuple}
Let~$G=G(n,q)$ be the binomial random graph with edge probability~$q=q(n)$,
and suppose~$H=(U,W;F)$ is a bipartite subgraph of~$G$.  Consider the
following three assertions for~$H$.
\begin{enumerate}
\item[(I)]$|U|=m_1$, $|W|=m_2$, $d_i=pm_i$ ($i\in\{1,2\}$), 
  $p=e(H)/m_1m_2$, and $e(H)\geq\alpha e(G[U,W])$.  
\item[(II)]$H[U,W]$ is $(\epsilon,q)$-regular.
\item[(III)]We have~$m_0=m_0(n)$ such that
  \begin{equation}
    \label{eq:k-tuple_m_0_lbd}
    q^km_0\gg(\log n)^4,
  \end{equation}
  and
  \begin{equation}
    \label{eq:k-tuples_rgs}
    m_1,\,m_2\geq m_0.
  \end{equation}
\end{enumerate}
We now consider subsets~$R\subset W$ of some fixed cardinality, say~$k$,
with~$k\geq2$, and classify them according to the size of their joint
neighbourhood in~$H$.  In fact, we let
\begin{equation}
  \label{eq:bad_k_tuples}
  \cB^{(k)}(U,W;\gamma)
    =\cB_H^{(k)}(U,W;\gamma)
    =\left\{R\in{W\choose k}\:
      \left|d_U^H(R)-p^km_1\right|\geq\gamma p^km_1\right\},
\end{equation}
where
\begin{equation}
  \label{eq:k-tuples_rgs_conclusion2}
  d_U^H(R)=\left|U\cap\bigcap_{x\in R}\Gamma_H(x)\right| 
          =\left|\bigcap_{x\in R}\Gamma_H(x)\right|. 
\end{equation}
Note that, in particular, $\cB^{(2)}(U,W;\gamma)=F_H(W,U;\gamma)$.  We are
interested in an upper estimate for~$\big|\cB^{(k)}(U,W;\gamma)\big|$.
Consider the inequality
\begin{enumerate}
\item[(IV)]
  \begin{equation}
    \label{eq:k-tuples_rgs_upbd}
    \big|\cB^{(k)}(U,W;\gamma)\big|\leq\eta{m_2\choose k}.
  \end{equation}
\end{enumerate}
Our result states that property~(IV) may be guaranteed almost surely for
arbitrarily small constants~$\gamma>0$ and~$\eta>0$, by requiring
that the graph~$H=(U,W;F)$ should be $\epsilon$-regular with a suitably
small~$\epsilon$.  

\begin{theorem}[The $k$-tuple lemma, r.gs version]
  \label{cor:k-tuples_rgs}
  For all~$\alpha>0$, $\gamma>0$, $\eta>0$, and~$k\geq2$, there
  is~$\epsilon>0$ such that almost every~$G=G(n,q)$ satisfies the following
  property.  If conditions~{\rm(I)}--{\rm(III)} apply to a bipartite
  subgraph~$H=(U,W;F)$ of~$G$ then condition~{\rm(IV)} also applies. 
\end{theorem}

\subsubsection{The proof of the $k$-tuple lemma}
\label{sec:proofof_k-tuple}
In this section, we prove the $k$-tuple lemma for subgraphs of random graphs,
Theorem~\ref{cor:k-tuples_rgs}. 

\begin{proof}[Proof of Theorem~\ref{cor:k-tuples_rgs}]
  The proof will be by induction on~$k$.  To formalise the proof, we start by
  making the following definition.
  \begin{definition}[$\Pi_k(\alpha,\gamma,\eta,k;\epsilon)$]
    \label{def:Pi_k}
    We say that property~$\Pi_k(\alpha,\gamma,\eta,k;\epsilon)$ holds for a
    graph~$G$ if any subgraph~$H=(U,W;F)$ of~$G$ that satisfies properties
    {\rm(I)--(III)} with parameters~$\alpha$, $\epsilon$, and~$k$ also
    satisfies property~{\rm(IV)} with parameters~$\gamma$, $\eta$, and~$k$.
  \end{definition}
  We shall prove by induction on~$k$ that the following statement holds for
  all~$k\geq2$.
  \begin{enumerate}
  \item[($\cS_k$)]\sl for every $\alpha>0$, $\gamma>0$, and $\eta>0$, there is 
    $\epsilon>0$ such that
    \begin{equation}
      \label{eq:ddag}
      \PP\{\Pi_k(\alpha,\gamma,\eta,k;\epsilon)
      \text{ holds for }G(n,q)\}=1-o(1).  
    \end{equation}
  \end{enumerate}
  Suppose~$k=2$.  Apply Theorem~\ref{cor:pcl} with
  constants~$\alpha(\ref{cor:pcl})=\alpha$
  and~$\gamma(\ref{cor:pcl})=\min\{\gamma,\eta\}$.  Theorem~\ref{cor:pcl}
  then gives a constant~$\epsilon(\ref{cor:pcl})>0$.  It then suffices to
  take~$\epsilon=\epsilon(\ref{cor:pcl})$.  Relation~\eqref{eq:ddag} then
  follows from Theorem~\ref{cor:pcl}.
  
  We now proceed to the induction step.  Assume that~$k\geq3$ and
  that~$(\cS_{k-1})$ holds.  Let~$\alpha=\alpha_k>0$, $\gamma=\gamma_k>0$
  and~$\eta=\eta_k>0$ be given.  In order to define an appropriate
  constant~$\epsilon=\epsilon_k>0$ to make~\eqref{eq:ddag} hold, we invoke the
  induction hypothesis~$(\cS_{k-1})$ and
  Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}.
  
  We need some technical preparation.  Let~$\gamma_0$, $\sigma_0$,
  and~$\sigma_0'$ be small enough positive constants satisfying the following
  properties:
  \begin{equation}
    \label{eq:0_constants}
    0<\sigma_0\leq{1\over k-1}
    \qquad\text{and}\qquad
    0<\sigma_0'\leq1,
  \end{equation}
  \begin{equation}
    \label{eq:0_constants+}
    (1+\gamma_0)(1+2\{2(k-1)\sigma_0+\sigma_0'\})\leq1+\gamma,
  \end{equation}
  and
  \begin{equation}
    \label{eq:0_constants-}
    (1-\gamma_0)(1-2\{2(k-1)\sigma_0+\sigma_0'\})\geq1-\gamma.
  \end{equation}
  Below, we shall use that, for any integer~$\ell\geq1$,  
  \begin{equation}
    \label{eq:1+x}
    (1+x)^\ell\leq1+2\ell x
    \quad\text{for all~$0\leq x\leq1/\ell$},
  \end{equation}
  and
  \begin{equation}
    \label{eq:1-x}
    (1-x)^\ell\geq1-\ell x
    \quad\text{for all~$0\leq x\leq3/\ell$}.
  \end{equation}
  Moreover, 
  \begin{equation}
    \label{eq:1+x+y}
    (1+x)(1+y)\leq1+2(x+y)
    \quad\text{if~$x$, $y\geq0$ and~$\min\{x,y\}\leq1$},
  \end{equation}
  and
  \begin{equation}
    \label{eq:1-x-y}
    (1-x)(1-y)\geq1-x-y
    \quad\text{if~$x$, $y\geq0$}.
  \end{equation}
  
  We now let~$\alpha_{k-1}=\alpha/3$, $\gamma_{k-1}=\gamma_0$,
  and~$\eta_{k-1}=\eta/10$ and invoke the induction hypothesis~$(\cS_{k-1})$
  with these constants.  Then, assertion~$(\cS_{k-1})$ gives us a
  constant~$\epsilon_{k-1}>0$.  We now apply
  Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs} with the following constants:
  let~$\alpha(\ref{cor:1-sided_nbhd_lemma2_rgs})=\alpha$,
  $\epsilon(\ref{cor:1-sided_nbhd_lemma2_rgs})=\epsilon_{k-1}/4$,
  $\sigma(\ref{cor:1-sided_nbhd_lemma2_rgs})=\sigma_0$,
  $\sigma'(\ref{cor:1-sided_nbhd_lemma2_rgs})=\sigma_0'$,
  $\mu(\ref{cor:1-sided_nbhd_lemma2_rgs})=\eta/10$,
  and~$\nu(\ref{cor:1-sided_nbhd_lemma2_rgs})=1/k$.  Then,
  Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs} gives us a
  constant~$\epsilon'(\ref{cor:1-sided_nbhd_lemma2_rgs})>0$.  We put
  \begin{equation}
    \label{eq:def_epsilon}
    \epsilon=\epsilon_k=\epsilon'(\ref{cor:1-sided_nbhd_lemma2_rgs}), 
  \end{equation}
  and claim that~\eqref{eq:ddag} holds with this choice of~$\epsilon$.

  To prove our claim, let us consider~$G=G(n,q)$.  Because of the choice
  of~$\epsilon_{k-1}$, almost surely
  \begin{equation}
    \label{eq:Pi_holds}
    \text{property
    }\Pi_{k-1}(\alpha_{k-1},\gamma_{k-1},\eta_{k-1},k-1;\epsilon_{k-1})\text{
    holds for }G.  
  \end{equation}
  Recall now the definition of
  property~$\cN(q,m_0;\alpha,\epsilon,\sigma,\sigma',\mu,\nu;\epsilon')$ (see
  Definition~\ref{def:1-sided_nbhd_lemma2_rgs}).  Recall also that~$q^3m_0\geq
  q^km_0\gg(\log n)^4\geq\log n$ (see~\eqref{eq:k-tuple_m_0_lbd} in~(III)).
  By the choice of~$\epsilon=\epsilon'(\ref{cor:1-sided_nbhd_lemma2_rgs})$
  (see Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}), we almost surely have
  that
  \begin{equation}
    \label{eq:cN_holds}
    \text{property
      }\cN(q,m_0;\alpha,\epsilon_{k-1}/4,\sigma_0,\sigma_0',\eta/10,1/k;\epsilon)
    \text{
    holds for }G.
  \end{equation}
  Moreover, by Lemma~\ref{lem:ECB_rgs}, almost surely the following property
  holds for~$G=G(n,q)$.
  \begin{enumerate}
  \item[(*)]let~$m^{(1)}=m^{(1)}(n)$ be a function with~$qm^{(1)}\gg\log
    n$.  Then, if~$A$ and~$B$ are two disjoint vertex sets with~$|A|$,
    $|B|\geq m^{(1)}$, we have~$e(G[A,B])\sim q|A||B|$.
  \end{enumerate}
  We now state the following claim.

  \begin{claim}
    \label{claim:Pi_k_holds}
    Suppose~\eqref{eq:Pi_holds}, \eqref{eq:cN_holds}, and~{\rm(*)} hold.  Then
    \begin{equation}
      \label{eq:Pi_target_holds}
      \text{property }\Pi_k(\alpha,\gamma,\eta,k;\epsilon)\text{ holds for }G.
    \end{equation}  
  \end{claim}
  
  Since~\eqref{eq:Pi_holds}, \eqref{eq:cN_holds}, and~(*) hold with
  probability~$1-o(1)$, Claim~\ref{claim:Pi_k_holds} implies
  that~\eqref{eq:ddag} holds, and hence the induction step will be complete
  once we prove this claim.
  
  The proof of Claim~\ref{claim:Pi_k_holds} will be by contradiction, and it
  will be mostly based on four subclaims~(\textit{a})--(\textit{d}).
  
  \begin{proof}[Proof of Claim~\ref{claim:Pi_k_holds}]
    To verify~\eqref{eq:Pi_target_holds}, let~$H=(U,W;F)\subset G$ be such
    that (I)--(III) hold with parameters~$\alpha$, $\epsilon$, and~$k$.  We
    have to verify~\eqref{eq:k-tuples_rgs_upbd}.
    Put~$\cB=\cB_H^{(k)}(U,W;\gamma)$, and suppose for a contradiction that
    \begin{equation}
      \label{eq:cB_lbd}
      |\cB|>\eta{m_2\choose k}.
    \end{equation}
    A standard averaging argument gives the following.  There is a
    partition~$W=W'\cup W''$ with~$m_2'=|W'|=m_2/k$ and~$m_2''=|W''|=(1-1/k)m_2$ 
    such that
    \begin{equation}
      \label{eq:cB_prime_def}
      \cB'=\{R\in\cB\:|R\cap W'|=1\}
    \end{equation}
    satisfies
    \begin{equation}
      \label{eq:cB'_large}
      |\cB'|\geq{1\over2}c_k|\cB|\geq{1\over2}\eta c_k{m_2\choose k},
    \end{equation}
    where~$c_k=(1-1/k)^{k-1}$.  Fix such a partition~$W=W'\cup W''$.  Following
    the notation of Theorem~\ref{cor:1-sided_nbhd_lemma2_rgs}, we
    let~$H'=H[U,W']$ and~$H''=H[U,W'']$.  
    
    In what follows,  
    \begin{equation}
      \label{eq:def_degree}
      d_{\cB'}(w')=\big|\{R\in\cB'\:w'\in R\}\big|
    \end{equation}
    is the \textit{degree} of~$w'$ in the set system or hypergraph~$\cB'$.  We
    claim that assertion~(\textit{a}) below holds.  Note that this claim
    concerns the existence of many vertices~$w'\in W'$ that belong to many
    $k$-tuples~$R\in\cB'$.
  
    \assertion{\rm(\textit{a})}At least~$(\eta/6)m_2'=(\eta/6)|W'|$
    vertices~$w'\in W'$ are such that  
    \begin{equation}
      \label{eq:d_B_prime_lbd}
      d_{\cB'}(w')\geq{\eta\over6}{m_2''\choose k-1}.
    \end{equation}
    \endassertion
    \casebody
    To verify assertion~(\textit{a}), note that otherwise we would have
    \begin{multline*}
      |\cB'|=\sum_{w'\in W'}d_{\cB'}(w')
      <{\eta\over6}m_2'\times{m_2''\choose k-1}
      +m_2'\times{\eta\over6}{m_2''\choose k-1}\\
      ={\eta\over3}m_2'{m_2''\choose k-1}
      \sim{\eta\over3}{m_2\over k}\(1-{1\over k}\)^{k-1}{m_2-1\choose k-1}
      ={1\over3}\eta c_k{m_2\choose k},
    \end{multline*}
    which contradicts~\eqref{eq:cB'_large}.  Hence~(\textit{a}) does hold.  
    \endcasebody
  
    We now come to an assertion concerning vertices that behave well with
    respect to the graph~$H$.
     
    \assertion{\rm(\textit{b})}There are at
    least~$(1-\eta/10)m_2'=(1-\eta/10)|W'|$ vertices~$w'\in W'$ such that
    if~$\tU=\Gamma_{H'}(w')$ and~$\tH=H[\tU,W'']$, then
      \begin{enumerate}
      \item[(\textit{i})]$d_{H'}(w')
        =|\tU|\sim_{\sigma_0'}d_1=pm_1$,
      \item[(\textit{ii})]$\rho(w')=e(\tH)/|\tU||W''|
        \sim_{\sigma_0}p$,
      \item[(\textit{iii})]$\tH$ is $(\epsilon_{k-1}/4,\rho(w'))$-regular. 
      \end{enumerate}
    \endassertion
    \casebody
    To prove~(\textit{b}), first recall that~\eqref{eq:cN_holds} holds.  To
    apply property
    $$
    \cN(q,m_0;\alpha,\epsilon_{k-1}/4,\sigma_0,\sigma_0',\eta/10,1/k;\epsilon),
    $$
    consider $H=(U,W;F)\subset G$ and the partition~$W=W'\cup W''$ defined
    above.  By hypothesis~(I), we have that~$e(H[U,W])\geq\alpha e(G[U,W])$
    holds.  By~(II), we know that~$H[U,W]$ is $(\epsilon,q)$-regular.
    By~(III), we have~$m_1$, $m_2\geq m_0$.  Finally, we recall
    that~$|W'|\geq\nu(\ref{cor:1-sided_nbhd_lemma2_rgs})|W|=(1/k)|W|$
    and~$|W''|=(1-1/k)|W|\geq\nu(\ref{cor:1-sided_nbhd_lemma2_rgs})|W|=(1/k)|W|$.
    Therefore we may apply
    property~$\cN(q,m_0;\alpha,\epsilon_{k-1}/4,\sigma_0,\sigma_0',\eta/10,1/k;\epsilon)$,
    to deduce that there exist at
    least~$(1-\mu(\ref{cor:1-sided_nbhd_lemma2_rgs}))|W'|=(1-\eta/10)|W'|$
    vertices $w'\in W'$ for which (\textit{i})--(\textit{iii}) above hold.
    This completes the proof of~(\textit{b}).  \endcasebody
    
    From assertions~(\textit{a}) and~(\textit{b}) above, we know that there are
    at least~$(\eta/6-\eta/10)|W'|=(\eta/15)|W'|$ vertices~$w'\in W'$ for which
    inequality~\eqref{eq:d_B_prime_lbd} and
    properties~(\textit{i})--(\textit{iii}) in assertion~(\textit{b}) hold.  We
    now fix one such vertex~$w'$ and consider~$\tU=\Gamma_{H'}(w')$,
    $\tH=H[\tU,W'']$, and~$\rho(w')=e(\tH)/|\tU||W''|$.
    
    Consider
    \begin{align}
      \label{eq:c}
      \tcB=\tcB(w')&=\cB_{\tH}^{(k-1)}(\tU,W'';\gamma_{k-1})\nonumber\\
      &=\left\{\tR\in{W''\choose
          k-1}\:\left|d_{\tU}^{\tH}(\tR)-\rho^{k-1}|\tU|\right|
        \geq\gamma_{k-1}\rho^{k-1}|\tU|\right\},
    \end{align}
    where~$\rho=\rho(w')\sim_{\sigma_0}p$ and
    \begin{equation}
      \label{eq:k-tuples_rgs_dtUtH}
      d_\tU^\tH(\tR)=\left|\tU\cap\bigcap_{x\in\tR}\Gamma_\tH(x)\right|  
              =\left|\bigcap_{x\in\tR}\Gamma_\tH(x)\right|. 
    \end{equation}
    Our next claim is as follows.
    
    \assertion{\rm(\textit{c})}We have
    \begin{equation}
      \label{eq:tcB_is_large}
      |\tcB|=|\tcB(w')|\geq{\eta\over6}{m_2''\choose k-1}.
    \end{equation}
    \endassertion
    \casebody
    To prove assertion~(\textit{c}), we observe that if~\eqref{eq:d_B_prime_lbd}
    holds, then~\eqref{eq:tcB_is_large} must also hold.  More precisely, we have
    that if~$R=\tR\cup\{w'\}\in\cB'$ holds, where~$\tR\subset W''$,
    then~$\tR\in\tcB$ must hold.  Let us check this last implication.
    Suppose~$R=\tR\cup\{w'\}\in\cB'$, where~$\tR\subset W''$.  Then 
    \begin{equation}
      \label{eq:largedev_assumed}
      \big|d_U^H(R)-p^km_1\big|\geq\gamma p^km_1.
    \end{equation}
    In order to show that~$\tR\in\tcB$, we need to show that
    \begin{equation}
      \label{eq:largedev_required}
      \big|d_\tU^\tH(\tR)-\rho^{k-1}|\tU|\big|\geq\gamma_{k-1}\rho^{k-1}|\tU|. 
    \end{equation}
    Observe that~(\textit{ii}) of claim~(\textit{b}) and~\eqref{eq:1+x}
    and~\eqref{eq:1-x} with~$\ell=k-1$ and~\eqref{eq:0_constants} imply that
    \begin{equation}
      \label{eq:rho_vs_p1}
      \rho^{k-1}|\tU|\sim_{2(k-1)\sigma_0}p^{k-1}|\tU|.
    \end{equation}
    The right-hand side of~\eqref{eq:rho_vs_p1} is, by~(\textit{i}) of
    claim~(\textit{b}),
    \begin{equation}
      \label{eq:rho_vs_p1.5}
      \sim_{\sigma_0'}p^km_1.
    \end{equation}
    Relations~\eqref{eq:rho_vs_p1} and~\eqref{eq:rho_vs_p1.5} imply,
    by~\eqref{eq:0_constants}, \eqref{eq:1+x+y} and~\eqref{eq:1-x-y}, that
    \begin{equation}
      \label{eq:rho_vs_p2}
      \rho^{k-1}|\tU|\sim_{2\{2(k-1)\sigma_0+\sigma_0'\}}p^km_1.
    \end{equation}
    Thus, recalling that~$\gamma_{k-1}=\gamma_0$, we have,
    by~\eqref{eq:0_constants+} and~\eqref{eq:0_constants-}, that
    \begin{multline}
      \label{eq:subinterval}
      (1-\gamma)p^km_1
      \leq(1-\gamma_{k-1})(1-2\{2(k-1)\sigma_0+\sigma_0'\})p^km_1\\
      \leq(1-\gamma_{k-1})\rho^{k-1}|\tU|
      \leq(1+\gamma_{k-1})\rho^{k-1}|\tU|\\
      \leq(1+\gamma_{k-1})(1+2\{2(k-1)\sigma_0+\sigma_0'\})p^km_1
      \leq(1+\gamma)p^km_1.
    \end{multline}
    However, the string of inequalities in~\eqref{eq:subinterval} implies that,
    indeed, inequality~\eqref{eq:largedev_assumed} implies
    inequality~\eqref{eq:largedev_required}.  Thus assertion~(\textit{c}) is
    proved.  \endcasebody
    
    We now recall that~\eqref{eq:Pi_holds} holds, and apply this
    to~$\tH=H[\tU,W'']\subset G$.  In order to do this, we have to verify that
    conditions~(I)--(III) apply to~$\tH$.
  
    \assertion{\rm(\textit{d})}Properties~{\rm(I)--(III)} hold
    for~$\tH=H[\tU,W'']$ with parameters~$\alpha_{k-1}=\alpha/3$,
    $\epsilon_{k-1}$, and~$k-1$.  
    \endassertion
    \casebody
    Using hypothesis~(I) on~$H$ and~(*), we observe that~$e(H[U,W])\geq\alpha
    e(G[U,W])\sim\alpha q|U||W|$, and hence~$p=e(H[U,W])/|U||W|\gtrsim\alpha
    q$.  To verify~(I) for~$\tH=H[\tU,W'']$, we use~(*) again to deduce
    that~$e(G[\tU,W''])\sim q|\tU||W''|$, and hence,
    by~(\textit{b})(\textit{ii}), we
    have~$\rho=\rho(w')\sim_{\sigma_0}p\gtrsim\alpha q$.
    Since~$\alpha_{k-1}=\alpha/3$, we obtain
    that~$e(H[\tU,W''])\geq\alpha_{k-1}e(G[\tU,W''])$ and assertion~(I)
    follows for~$\tH$ with parameter~$\alpha_{k-1}=\alpha/3$.
  
    For later reference, let us observe that~(*) also implies
    that
    \begin{equation}
      \label{eq:p_and_q_sec.4.5}
      p={e(H[U,W])\over|U||W|}\leq{e(G[U,W])\over|U||W|}\sim q,
    \end{equation}
    and hence we may assume that~$p\leq2q$.
    
    We turn to~(II).  Our choice of~$w'$ guarantees that~$\tH=H[\tU,W'']$ is
    $(\epsilon_{k-1}/4,\rho)$-regular (see~(\textit{b})(\textit{iii})).  To
    verify~(II), we shall show that this implies that~$\tH$ is
    $(\epsilon_{k-1},q)$-regular.  Suppose~$\tU'\subset\tU$ and~$W'''\subset
    W''$ are such that~$|\tU'|\geq\epsilon_{k-1}|\tU|$
    and~$|W'''|\geq\epsilon_{k-1}|W''|$.  By the
    $(\epsilon_{k-1}/4,\rho)$-regularity of~$\tH=H[\tU,W'']$,
    and recalling that
    \begin{equation}
      \label{eq:remind_rho}
      \rho={e(\tH)\over|\tU||W''|}={e(H[\tU,W''])\over|\tU||W''|},
    \end{equation}
    we see that
    \begin{equation}
      \label{eq:e/4-reg}
      \left|{e(H[\tU',W'''])\over\rho|\tU'||W'''|}
        -{e(H[\tU,W''])\over\rho|\tU||W''|}\right|
      =\left|{e(H[\tU',W'''])\over\rho|\tU'||W'''|}-1\right|
      \leq{1\over4}\epsilon_{k-1}.
    \end{equation}
    But then, we have
    \begin{multline}
      \label{eq:e-reg}
      \left|{e(H[\tU',W'''])\over q|\tU'||W'''|}
        -{e(H[\tU,W''])\over q|\tU||W''|}\right|
      =\left|{e(H[\tU',W'''])\over q|\tU'||W'''|}-{\rho\over q}\right|\\
      ={\rho\over q}\left|{e(H[\tU',W'''])\over\rho|\tU'||W'''|}-1\right|
      \leq{\rho\over4q}\epsilon_{k-1}\\
      \leq{\rho\over2p}\epsilon_{k-1}
      \leq{1\over2}(1+\sigma_0)\epsilon_{k-1}
      \leq\epsilon_{k-1},
    \end{multline}
    where we used that, as observed above, $q\geq p/2$
    and~$\rho\sim_{\sigma_0}p$ (cf.~(\textit{b})(\textit{ii})).  It now suffices
    to notice that~\eqref{eq:e-reg} implies that~$\tH=H[\tU,W'']$ is indeed
    $(\epsilon_{k-1},q)$-regular.
  
    Finally, for~(III), we observe that, by~(\textit{b})(\textit{i}) and the
    fact that~$p\gtrsim\alpha q$,
    \begin{equation}
      \label{eq:(III)_k-1}
      q^{k-1}|\tU|\sim_{\sigma_0'}q^{k-1}pm_1
      \gtrsim\alpha q^km_1\gg(\log n)^4.
    \end{equation}
    Moreover, 
    \begin{equation}
      \label{eq:(III)_k-1_b}
      q^{k-1}|W''|=q^{k-1}\(1-{1\over k}\)|W|
      =\(1-{1\over k}\)q^{k-1}m_2\gg(\log n)^4.
    \end{equation}
    Therefore we indeed do have that properties (I)--(III) hold
    for~$\tH=H[\tU,W'']$. 
    \endcasebody
  
    Since~\eqref{eq:Pi_holds} holds and assertion~(\textit{d}) above holds, we
    conclude that  
    \begin{equation}
      \label{eq:tcB_upbd}
      |\tcB|=|\cB_\tH^{(k-1)}(\tU,W'';\gamma_{k-1})|
      \leq\eta_{k-1}{m_2''\choose k-1}=
      {\eta\over10}{m_2''\choose k-1}.
    \end{equation}
    Comparing~\eqref{eq:tcB_is_large} and~\eqref{eq:tcB_upbd}, we arrive at a
    contradiction.  Therefore~\eqref{eq:cB_lbd} must fail and
    hence~\eqref{eq:Pi_target_holds} does hold.  This completes the proof of
    Claim~\ref{claim:Pi_k_holds}. 
  \end{proof}
  
  As observed after the statement of Claim~\ref{claim:Pi_k_holds}, the
  validity of this claim completes the induction step and hence
  Theorem~\ref{cor:k-tuples_rgs} follows by induction.
\end{proof}

\section{An example}
\label{sec:counterexample}
In Section~\ref{sec:pcl}, we remarked that, in the sparse context, the
$o(1)$-regularity of a bipartite graph $B=(U,W;E)$ does not necessarily imply
property $\PC(U,W;o(1))$ (cf.~Remark~\ref{remark:deterministic_pcl}).  In this
section we justify this claim.

\subsection{The construction}
\label{sec:construction}
We shall prove the existence of examples of bipartite graphs~$(U,W;E)$ that
are very regular, but fail to satisfy property~$\PC(U,W;\gamma)$ for some
fixed~$\gamma>0$.  Clearly, our graphs will have vanishing density, since we
know that $o(1)$-regularity implies~$\PC(U,W;o(1))$ in the `dense' set-up.
The proof will be probabilistic.

\begin{theorem}
  \label{thm:counterexample}
  For every~$0<\alpha<1$ and~$0<\epsilon<1$, there exist~$0<p<1$
  and~$m_0\geq1$ such that for every~$m>m_0$ there is a bipartite
  graph~$J=(U,W;E)$ with~$|U|=|W|=m$ and~$|E|\sim_\epsilon pm^2$ such that
  \begin{enumerate}
  \item[(\textit{i})]$J$~satisfies the following property: for all~$U'\subset
    U$ and~$W'\subset W$ with~$|U'|$, $|W'|\geq\epsilon m$, we have
    \begin{equation}
      \label{eq:countereample_i}
      \big||E[U',W']|-p|U'||W'|\big|\leq\epsilon p|U'||W'|,
    \end{equation}
    while
  \item[(\textit{ii})]for all but~$\leq\alpha m^2$
    pairs~$\{u_1,u_2\}\in{U\choose2}$, we have
    \begin{equation}
      \label{eq:counterexample}
      \Gamma_J(u_1)\cap\Gamma_J(u_2)=\emptyset
      \text{ and consequently }
      \big||\Gamma_J(u_1)\cap\Gamma_J(u_2)|-p^2m\big|>\epsilon p^2m.
    \end{equation}
  \end{enumerate}
\end{theorem}

The proof of Theorem~\ref{thm:counterexample} will be based on the two claims
below. 

\begin{claim}
  \label{claim:A}
  Let~$T=(A,B;F)$ be a bipartite graph and let a function $\mu\:A\cup
  B\to[0,1]$ be given.  Assume moreover that 
  \begin{equation}
    \label{eq:total_mus}
    \text{both }
    \mu(A)=\sum_{a\in A}\mu(a)
    \text{ and }
    \mu(B)=\sum_{b\in B}\mu(b)
    \text{ are integers.}
  \end{equation}
  Then there exist sets~$A_i\subset A$ and~$B_i\subset B$ $(i\in\{0,1\})$ such
  that 
  \begin{enumerate}
  \item[(\textit{i})]$|A_0|=|A_1|=\sum_{a\in A}\mu(a)$,
  \item[(\textit{ii})]$|B_0|=|B_1|=\sum_{b\in B}\mu(b)$, 
  \end{enumerate}
  and
  \begin{enumerate}
  \item[(\textit{iii})]
    \begin{equation}
      \label{eq:claim_A_iii}
      |F[A_0,B_0]|\leq\sum_{ab\in F}\mu(a)\mu(b)
      \leq|F[A_1,B_1]|,
    \end{equation}
    where
    \begin{equation}
      \label{eq:E[A,B]_def}
      |F[A_i,B_i]|=e(T[A_i,B_i])=\big|\{(a,b)\:a\in A_i,\;b\in B_i,\;ab\in
       F\}\big|. 
    \end{equation}
  \end{enumerate}
\end{claim}
\begin{proof}
  Set~$M(A)=\{a\in A\:0<\mu(a)<1\}$ and~$M(B)=\{b\in B\:0<\mu(b)<1\}$.  We
  shall prove the existence of the sets~$A_0$ and~$B_0$; the sets~$A_1$
  and~$B_1$ may be constructed analogously.

  Assume that~$M(A)\neq\emptyset$ or~$M(B)\neq\emptyset$.  We shall
  alter~$\mu$ in two rounds, maintaining valid the following assertions: 
  \begin{enumerate}
  \item[(\textit{a})]properties~(\textit{i}) and~(\textit{ii}) hold,
  \item[(\textit{b})]$M(A)=\emptyset$ after the first round, and~$M(A)\cup
    M(B)=\emptyset$ after the second round,
  \end{enumerate}
  and, moreover, 
  \begin{enumerate}
  \item[(\textit{c})]the value of~$\sum_{ab\in F}\mu(a)\mu(b)$ decreases in
    each round.
  \end{enumerate}
  (For constructing~$A_1$ and~$B_1$, we would proceed
  analogously---maintaining~(\textit{a}) and~(\textit{b}), while increasing
  the value of the sum in~(\textit{c}).)  Without loss of generality, assume
  that $M(A)=\{a_1,\dots,a_r\}\neq\emptyset$.  Assume that
  \begin{equation}
    \label{eq:increasing_gamma}
    \mu(\Gamma_T(a_1))\leq\dots\leq\mu(\Gamma_T(a_r)).
  \end{equation}
  Since~$\mu(A)$ is an integer (see~\eqref{eq:total_mus}), 
  \begin{equation}
    \label{eq:br_def}
    \br=\sum_{i=1}^r\mu(a_i)
  \end{equation}
  must be an integer as well.  We define~$\mu_A\:A\cup B\to[0,1]$ as follows: 
  \begin{equation}
    \label{eq:mu_1s}
    \mu_A(a_1)=\dots=\mu_A(a_\br)=1,
    \qquad
    \mu_A(a_{\br+1})=\dots=\mu_A(a_r)=0,
  \end{equation}
  and
  \begin{equation}
    \label{eq:mu_stay_still}
    \mu_A(x)=\mu(x)\text{ for all }x\in (A\cup B)\setminus\{a_1,\dots,a_r\}. 
  \end{equation}
  Observe that~$\mu_A$ satisfies property~(\textit{a}), we have
  $M(A)=\emptyset$, and
  \begin{equation}
    \label{eq:decreased}
    \sum_{ab\in F}\mu_A(a)\mu_A(b)\leq\sum_{ab\in F}\mu(a)\mu(b).  
  \end{equation}
  Now, if~$M(B)=\emptyset$, then, putting, 
  \begin{equation}
    \label{eq:got_it_easy}
    A_0=\{a\in A\:\mu_A(a)=1\}
    \quad\text{and}\quad
    B_0=\{b\in B\:\mu_A(b)=1\},
  \end{equation}
  we have that~(\textit{i}), (\textit{ii}), and~(\textit{iii}) hold and we are
  done.  Therefore, let us assume that~$M(B)\neq\emptyset$.  We repeat the
  procedure of the first round with~$A$ replaced by~$B$.  More precisely, if
  $M(B)=\{b_1,\dots,b_s\}\neq\emptyset$, 
  \begin{equation}
    \label{eq:increasing_Gamma}
    \mu(\Gamma_T(b_1))\leq\dots\leq\mu(\Gamma_T(b_s)),
  \end{equation}
  and~$\bs=\sum_{i=1}^s\mu(b_i)$, we define $\mu_B\:A\cup B\to[0,1]$ as
  follows: 
  \begin{equation}
    \label{eq:mu_1sb}
    \mu_B(b_1)=\dots=\mu_B(b_\bs)=1,
    \qquad
    \mu_B(b_{\bs+1})=\dots=\mu_B(b_s)=0,
  \end{equation}
  and
  \begin{equation}
    \label{eq:mu_stay_stillb}
    \mu_B(x)=\mu_A(x)\text{ for all }x\in (A\cup B)\setminus\{b_1,\dots,b_s\}. 
  \end{equation}
  Set
  \begin{equation}
    \label{eq:got_it_this_time}
    A_0=\{a\in A\:\mu_B(a)=1\}
    \quad\text{and}\quad
    B_0=\{b\in B\:\mu_B(b)=1\},
  \end{equation}
  and observe that~(\textit{i}), (\textit{ii}), and~(\textit{iii}) hold.
\end{proof}

The second claim on which the proof of Theorem~\ref{thm:counterexample} is
based is as follows.

\begin{claim}
  \label{claim:B}
  For every~$0<\alpha<1/2$ and~$0<\epsilon<1/2$, there exist an integer~$t$
  and a bipartite graph~$T=(A,B;F)$ with~$|A|=|B|=t$ and satisfying the
  following properties.
  \begin{enumerate}
  \item[(\textit{i})]$|F|=dt^2$, where
    \begin{equation}
      \label{eq:d_bounds_B}
      d\sim_\epsilon{\alpha\over\sqrt t},
    \end{equation}
  \item[(\textit{ii})]For every~$A'\subset A$ and~$B'\subset B$
    with~$|A'|\geq\epsilon|A|$ and~$|B'|\geq\epsilon|B|$, we have 
    \begin{equation}
      \label{eq:num_edges_B}
      |F[A',B']|=e(T[A',B'])\sim_\epsilon{\alpha\over\sqrt t}|A'||B'|,
    \end{equation}
  \end{enumerate}
  where the notation is as in~\eqref{eq:E[A,B]_def}, and
  \begin{enumerate}
  \item[(\textit{iii})]
    \begin{equation}
      \label{eq:Claim_B(iii)}
      \left|\left\{\{a,a'\}\in{A\choose2}\:
          \Gamma_T(a)\cap\Gamma_T(a')=\emptyset\right\}\right|
      \geq(1-\alpha){t\choose2}.
    \end{equation}
  \end{enumerate}
\end{claim}
\begin{proof}
  Let~$t$ be such that
  \begin{equation}
    \label{eq:t_lbd_counter}
    \sqrt t\geq{3\log8\over\epsilon^4\alpha},
  \end{equation}
  and consider the binomial random bipartite graph~$\TT=(A,B;\FF)$, where each
  edge is chosen independently with probability~$p=\alpha/\sqrt t$.  We shall
  use the following form of Chernoff's inequality: let~$\FF_{n,p}$ be a random
  variable with binomial distribution~$\Bi(n,p)$; then, for
  all~$0<\epsilon<1$, 
  \begin{equation}
    \label{eq:Chernoff}
    \PP(|\FF_{n,p}-np|>\epsilon
    np)<\exp\left\{-{1\over3}\epsilon^2np\right\}. 
  \end{equation}
  Fix~$A'\subset A$ and~$B'\subset B$, with~$|A'|=a'\geq\epsilon t$
  and~$|B'|=b'\geq\epsilon t$.  We use~\eqref{eq:Chernoff} to infer that 
  \begin{equation}
    \label{eq:dev_upbd}
    \PP\(\big|\FF[A',B']-pa'b'\big|>\epsilon pa'b'\)
    <\exp\left\{-{1\over3}\epsilon^2pa'b'\right\}
    \leq\exp\left\{-{1\over3}\epsilon^4\alpha t^{3/2}\right\}.
  \end{equation}
  On the other hand, the number of choices for~$A'$ and~$B'$ does not
  exceed~$4^t$, and consequently the probability of the event
  that~(\textit{ii}) should fail is bounded from above by
  \begin{equation}
    \label{eq:prob_upbd}
    4^t\exp\left\{-{1\over3}\epsilon^4\alpha t^{3/2}\right\}.
  \end{equation}
  However, owing to the choice of~$t$ (cf.~\eqref{eq:t_lbd_counter}), the
  quantity in~\eqref{eq:prob_upbd} is smaller than~$1/2$.  We conclude by
  Markov's inequality that
  \begin{equation}
    \label{eq:formal_ii}
    \text{the probability that~(\textit{ii}) fails is~$\leq1/2$.}
  \end{equation}
  Now we turn our attention to property~(\textit{iii}).  Let~$\Ch$ be the
  random variable that counts the number of $2$-paths~$P$ in~$\FF$ with the
  two endpoints of~$P$ in~$A$ and the middle vertex of~$P$ in~$B$.  That is,
  let~$\Ch(\FF)$ be the number of $2$-paths of the
  form~$\big\{\{a,b\},\{b,a'\}\big\}$ in~$\FF$, where~$a$, $a'\in A$ and~$b\in
  B$.  Then, clearly, 
  \begin{equation}
    \label{eq:Ch_expect}
    \EE(\Ch(\FF))={t\choose2}p^2t=\alpha^2{t\choose2}.
  \end{equation}
  This means that, by Markov's inequality, 
  \begin{equation}
    \label{eq:many_ch}
    \PP\(\Ch(\FF)>\alpha{t\choose2}\)<\alpha\leq{1\over2}.
  \end{equation}

  Combining~\eqref{eq:formal_ii} and~\eqref{eq:many_ch}, we infer that there
  exists~$F$ with the following properties:
  \begin{enumerate}
  \item[(\textit{a})]for all~$A'\subset A$ and~$B'\subset B$
    with~$|A|=a'\geq\epsilon t$ and~$|B'|=b'\geq\epsilon t$, we have
    \begin{equation}
      \label{eq:F[A',B']}
      \big||F[A',B']|-pa'b'\big|\leq\epsilon pa'b',
    \end{equation}
    and hence~(\textit{i}) and~(\textit{ii}) hold,
  \end{enumerate}
  and
  \begin{enumerate}
  \item[(\textit{b})]$\Ch(F)\leq\alpha{t\choose2}$, and hence~(\textit{iii})
    holds. 
  \end{enumerate}
  The proof of Claim~\ref{claim:B} is complete.
\end{proof}

We shall actually need a slight technical extension of Claim~\ref{claim:B}.
To obtain this extension, note that, without loss of generality, we may assume
that~$\alpha$ and~$\epsilon$ in the statement of Claim~\ref{claim:B} are
reciprocal of integers larger than~$1$.  If we set
\begin{equation}
  \label{eq:new_t_def}
  t={40\over\epsilon^8\alpha^2},
\end{equation}
then~\eqref{eq:t_lbd_counter} holds, and, moreover, 
\begin{equation}
  \label{eq:new_t_def2}
  \epsilon t={40\over\epsilon^7\alpha^2}
\end{equation}
is an integer.  Thus, we have the following variant of Claim~\ref{claim:B}.

\begin{claim}
  \label{claim:B'}
  For every~$0<\alpha<1/2$ and~$0<\epsilon<1/2$ that are reciprocal of
  integers, there exist an integer~$t$ and a bipartite graph~$T=(A,B;F)$
  with~$|A|=|B|=t$ satisfying
  properties~{\rm(\textit{i})}--{\rm(\textit{iii})} of Claim~\ref{claim:B} and
  such that
  \begin{enumerate}
  \item[(\textit{iv})]$\epsilon t$ is an integer.
  \end{enumerate}
\end{claim}

\begin{proof}[Proof of Theorem~\ref{thm:counterexample}]
  Given~$\alpha>0$ and $\epsilon>0$, let~$0<\alpha'\leq\alpha/2$
  and~$0<\epsilon'\leq\epsilon/2$ be reciprocal of integers.  We apply
  Claim~\ref{claim:B'} with constants~$\alpha'$ and~$\epsilon'$ to obtain~$t$
  and the graph~$T=(A,B;F)$.  Let~$p=\alpha'/\sqrt t$.

  Let~$M_0\gg t$, and~$m_0=M_0t$.  Now, for a given~$m\geq m_0$, consider~$M$
  such that
  \begin{equation}
    \label{eq:m_window}
    (M-1)t<m\leq Mt.
  \end{equation}
  We construct the graph~$J$ as a `blow-up' of~$T$, replacing each
  vertex~$a\in A$ and~$b\in B$ of~$T$ by sets~$U_a$ and~$W_b$, respectively,
  with~$U_a$ and~$W_b$ of cardinality~$M$ or~$M-1$.  More precisely, consider
  pairwise disjoint sets~$U_a$ ($a\in A$), $W_b$ ($b\in B$), each of
  cardinality~$M$ or~$M-1$, and set
  \begin{equation}
    \label{eq:neuUandW}
    U=\bigcup_{a\in A}U_a
    \quad\text{and}\quad
    W=\bigcup_{b\in B}W_b.
  \end{equation}
  Let
  \begin{equation}
    \label{eq:edges_now}
    E=\big\{\{u,w\}\:u\in U_a,\;w\in W_b,\;\{a,b\}\in F\big\}.
  \end{equation}
  Suppose we are given~$U'\subset U$ and~$W'\subset W$
  with~$|U'|\geq\epsilon|U|$ and~$|W'|\geq\epsilon|W|$.
  Since~$\epsilon|U|=\epsilon|W|=\epsilon Mt$ is an integer, we may and shall
  assume that~$|U'|=|W'|=\epsilon Mt$.
  
  Define a mapping $\mu\:A\cup B\to[0,1]$ by putting
  \begin{equation}
    \label{eq:mu_def}
    \mu(a)={1\over M}|U'\cap U_a|
    \quad\text{and}\quad
    \mu(b)={1\over M}|W'\cap W_b|.
  \end{equation}
  Since~$\sum_{a\in A}\mu(a)=\sum_{b\in B}=\mu(b)=\epsilon Mt$ is an integer,
  we may apply Claim~\ref{claim:A} to find sets~$A_i$ and~$B_i$
  ($i\in\{0,1\}$) such that~(\textit{i})--(\textit{iii}) in the statement of
  that claim holds.  This however means that
  \begin{equation}
    \label{eq:edge_bound_counter}
    (M-1)^2|F[A_0,B_0]|\leq|E[U',W']|\leq M^2|F[A_1,B_1]|.
  \end{equation}
  Since~$|A_0|=|B_0|=|A_1|=|B_1|=\epsilon't$, we infer by Claim~\ref{claim:B'}
  that 
  \begin{equation}
    \label{eq:edge_upbd_counter}
    |F[A_1,B_1]|\leq{\alpha'\over\sqrt t}(1+\epsilon')\epsilon^2t^2
  \end{equation}
  and
  \begin{equation}
    \label{eq:edge_lwbd_counter}
    |F[A_0,B_0]|\geq{\alpha'\over\sqrt t}(1-\epsilon')\epsilon^2t^2.
  \end{equation}
  Consequently, 
  \begin{multline}
    \label{eq:both_bds_counter}
    p(1-\epsilon)
    \leq{(M-1)^2\over M^2}\times{\alpha\over\sqrt t}(1-\epsilon')\\
    \leq{|E[U',W']|\over|U'||W'|}
    \leq{\alpha\over\sqrt t}(1+\epsilon')
    \leq p(1+\epsilon).
  \end{multline}
  In order to verify property~(\textit{ii}), observe that, for~$u\in U_a$
  and~$u'\in U_{a'}$, we have that~$\Gamma_J(u)\cap\Gamma_J(u')=\emptyset$ if
  and only if~$\Gamma_T(a)\cap\Gamma_T(a')=\emptyset$.  Hence
  \begin{multline}
    \label{eq:prop_ii_counter}
    \left|\left\{\{u,u'\}\in{U\choose2}\:
        \Gamma_J(u)\cap\Gamma_J(u')=\emptyset
      \right\}\right|\\
    \geq(1-\alpha'){t\choose2}(M-1)^2\geq(1-\alpha){m\choose2}.
  \end{multline}
  This completes the proof of Theorem~\ref{thm:counterexample}.  
\end{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\bibliographystyle{amsplain}
%\bibliography{refs}
\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}
\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }
% \MRhref is called by the amsart/book/proc definition of \MR.
\providecommand{\MRhref}[2]{%
  \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}
}
\providecommand{\href}[2]{#2}
\begin{thebibliography}{10}

\bibitem{alon00:_univer}
N.~Alon, M.R. Capalbo, Y.~Kohayakawa, V.~R\"odl, A.~Ruci\'nski, and
  E.~Szemer\'edi, \emph{Universality and tolerance {\rm(}extended
  abstract{\rm)}}, Proceedings of the 41st IEEE Annual Symposium on Foundations
  of Computer Science (FOCS 2000), 2000, pp.~14--21.

\bibitem{alon88:_explic}
N.~Alon and F.~R.~K. Chung, \emph{Explicit construction of linear sized
  tolerant networks}, Discrete Mathematics \textbf{72} (1988), no.~1-3, 15--19.
  \MR{90f:05080}

\bibitem{AlonDLRY92}
N.~Alon, R.~A. Duke, H.~Lefmann, V.~R{\"o}dl, and R.~Yuster, \emph{The
  algorithmic aspects of the regularity lemma {\rm(}extended abstract{\rm)}},
  33rd Annual Symposium on Foundations of Computer Science (Pittsburgh,
  Pennsylvania), IEEE Comput. Soc. Press, 1992, pp.~473--481.

\bibitem{alon94}
\bysame, \emph{The algorithmic aspects of the regularity lemma}, J. Algorithms
  \textbf{16} (1994), no.~1, 80--109. \MR{94j:05112}

\bibitem{babai86:_compl}
L{\'a}szl{\'o} Babai, P{\'e}ter Frankl, and J{\'a}nos Simon, \emph{Complexity
  classes in communication complexity theory {\rm(}preliminary version{\rm)}},
  27th Annual Symposium on Foundations of Computer Science (Toronto, Ontario,
  Canada), IEEE, 1986, pp.~337--347.

\bibitem{Beck}
J{\'o}zsef Beck, \emph{On size {R}amsey number of paths, trees, and
  circuits~{I}}, Journal of Graph Theory \textbf{7} (1983), 115--129.

\bibitem{BeckB}
\bysame, \emph{On size {R}amsey number of paths, trees, and circuits~{II}},
  Mathematics of {R}amsey Theory, Algorithms and Combinatorics, vol.~5,
  Springer-Verlag, Berlin, 1990, pp.~34--45.

\bibitem{BBf}
B{\'e}la Bollob{\'a}s, \emph{Random graphs}, Academic Press Inc. [Harcourt
  Brace Jovanovich Publishers], London, 1985. \MR{87f:05152}

\bibitem{chung89}
F.~R.~K. Chung, R.~L. Graham, and R.~M. Wilson, \emph{Quasi-random graphs},
  Combinatorica \textbf{9} (1989), no.~4, 345--362.

\bibitem{chung01:_spars}
Fan Chung and Ronald Graham, \emph{Sparse quasi-random graphs}, Combinatorica
  \textbf{22} (2002), no.~2, 217--244, Special issue: {P}aul {E}rd{\H o}s and
  his mathematics. \MR{1 909 084}

\bibitem{DukeLefmannRodlcount}
R.~A. Duke, H.~Lefmann, and V.~R\"odl, \emph{A fast approximation algorithm for
  computing the frequencies of subgraphs in a given graph}, SIAM Journal on
  Computing \textbf{24} (1995), no.~3, 598--620.

\bibitem{erdoes47:_some}
P.~Erd{\H o}s, \emph{Some remarks on the theory of graphs}, Bull. Amer. Math.
  Soc. \textbf{53} (1947), 292--294. \MR{8,479d}

\bibitem{erdos81:_i}
\bysame, \emph{On the combinatorial problems which {I} would most like to see
  solved}, Combinatorica \textbf{1} (1981), no.~1, 25--42. \MR{82k:05001}

\bibitem{erdos78:_ramsey}
P.~Erd{\H o}s, R.~J. Faudree, C.~C. Rousseau, and R.~H. Schelp, \emph{The size
  {R}amsey number}, Periodica Mathematica Hungarica \textbf{9} (1978), no.~2-2,
  145--161. \MR{80h:05037}

\bibitem{erd74:_probab}
Paul Erd{\H{o}}s and Joel Spencer, \emph{Probabilistic methods in
  combinatorics}, Academic Press [A subsidiary of Harcourt Brace Jovanovich,
  Publishers], New York-London, 1974, Probability and Mathematical Statistics,
  Vol. 17. \MR{52 \#2895}

\bibitem{frankl86}
P.~Frankl and V.~R{\"o}dl, \emph{Large triangle-free subgraphs in graphs
  without ${K}\sb 4$}, Graphs and Combinatorics \textbf{2} (1986), no.~2,
  135--144.

\bibitem{frankl88}
P.~Frankl, V.~R{\"o}dl, and R.~M. Wilson, \emph{The number of submatrices of a
  given type in a {H}adamard matrix and related results}, Journal of
  Combinatorial Theory, Series B \textbf{44} (1988), no.~3, 317--328.

\bibitem{friedgut00:_sharp_ramsey}
Ehud Friedgut and Michael Krivelevich, \emph{Sharp thresholds for certain
  {R}amsey properties of random graphs}, Random Structures Algorithms
  \textbf{17} (2000), no.~1, 1--19. \MR{2001i:05136}

\bibitem{friedman87:_expan}
J.~Friedman and N.~Pippenger, \emph{Expanding graphs contain all small trees},
  Combinatorica \textbf{7} (1987), no.~1, 71--76. \MR{88k:05063}

\bibitem{Fu}
Z.~F{\"u}redi, \emph{Random {R}amsey graphs for the four-cycle}, Discrete
  Mathematics \textbf{126} (1994), 407--410.

\bibitem{hajnal70:_proof_p}
A.~Hajnal and E.~Szemer{\'e}di, \emph{Proof of a conjecture of {P}. {E}rd{\H
  o}s}, Combinatorial theory and its applications, II (Proc. Colloq.,
  Balatonf\"ured, 1969), North-Holland, Amsterdam, 1970, pp.~601--623. \MR{45
  \#6661}

\bibitem{HKL}
P.~E. Haxell, Y.~Kohayakawa, and T.~{\L}uczak, \emph{The induced size-{R}amsey
  number of cycles}, Combinatorics, Probability, and Computing \textbf{4}
  (1995), no.~3, 217--239.

\bibitem{HKLeven}
\bysame, \emph{Tur\'an's extremal problem in random graphs: forbidding even
  cycles}, J. Combin. Theory Ser. B \textbf{64} (1995), no.~2, 273--287.
  \MR{96e:05151}

\bibitem{HKLodd}
\bysame, \emph{Tur\'an's extremal problem in random graphs: forbidding odd
  cycles}, Combinatorica \textbf{16} (1996), no.~1, 107--122. \MR{97k:05180}

\bibitem{janson00:_random_graph}
Svante Janson, Tomasz {\L}uczak, and Andrzej Ruci{\'n}ski, \emph{Random
  graphs}, Wiley-Interscience, New York, 2000. \MR{2001k:05180}

\bibitem{Kohayakawa97Szemeredi}
Y.~Kohayakawa, \emph{Szemer\'edi's regularity lemma for sparse graphs},
  Foundations of computational mathematics (Rio de Janeiro, 1997), Springer,
  Berlin, 1997, pp.~216--230. \MR{99g:05145}

\bibitem{KKreuterCycles}
Y.~Kohayakawa and B.~Kreuter, \emph{Threshold functions for asymmetric {R}amsey
  properties involving cycles}, Random Structures Algorithms \textbf{11}
  (1997), no.~3, 245--276. \MR{99g:05159}

\bibitem{KKS}
Y.~Kohayakawa, B.~Kreuter, and A.~Steger, \emph{An extremal problem for random
  graphs and the number of graphs with large even-girth}, Combinatorica
  \textbf{18} (1998), no.~1, 101--120. \MR{2000b:05118}

\bibitem{KLRap3}
Y.~Kohayakawa, T.~{\L}uczak, and V.~R{\"o}dl, \emph{Arithmetic progressions of
  length three in subsets of a random set}, Acta Arith. \textbf{75} (1996),
  no.~2, 133--163. \MR{97b:11011}

\bibitem{KLRfour}
\bysame, \emph{On {$K\sp 4$}-free subgraphs of random graphs}, Combinatorica
  \textbf{17} (1997), no.~2, 173--213. \MR{98h:05166}

\bibitem{kohayakawa00:_regul_ii}
Y.~Kohayakawa and V.~R\"odl, \emph{Regular pairs in sparse random graphs {II}},
  in preparation, 2001.

\bibitem{KohayakawaRSz99sizeRamsey}
Y.~Kohayakawa, V.~R\"odl, and E.~Szemer\'edi, \emph{The size-{R}amsey number of
  graphs of bounded degree}, in preparation, 2001.

\bibitem{KomlosSimonovits96}
J.~Koml{\'o}s and M.~Simonovits, \emph{Szemer\'edi's regularity lemma and its
  applications in graph theory}, Combinatorics, Paul Erd\H os is eighty, Vol.\
  2 (Keszthely, 1993), J\'anos Bolyai Math. Soc., Budapest, 1996, pp.~295--352.
  \MR{97d:05172}

\bibitem{luczak94}
T.~{\L}uczak, \emph{personal communication}, 1994.

\bibitem{luczak92:_ramsey}
Tomasz {\L}uczak, Andrzej Ruci{\'n}ski, and Bernd Voigt, \emph{Ramsey
  properties of random graphs}, J. Combin. Theory Ser. B \textbf{56} (1992),
  no.~1, 55--68. \MR{94b:05172}

\bibitem{rodl86}
V.~R{\"o}dl, \emph{On universality of graphs with uniformly distributed edges},
  Discrete Mathematics \textbf{59} (1986), no.~1-2, 125--134.

\bibitem{roedl99:_hyper}
V.~R\"odl, A.~Ruci\'nski, and A.~Taraz, \emph{Hypergraph packing and graph
  embedding}, Combinatorics, Probability and Computing \textbf{8} (1999),
  no.~4, 363--376.

\bibitem{RodlRucinski93}
Vojt{\v{e}}ch R{\"o}dl and Andrzej Ruci{\'n}ski, \emph{Lower bounds on
  probability thresholds for {R}amsey properties}, Combinatorics---{P}aul
  {E}rd{\H o}s is eighty, {\rm vol.~1 (Keszthely, 1993)} (D.~Mikl{\'o}s, V.~T.
  S{\'o}s, and T.~Sz{\H o}nyi, eds.), Bolyai Society Mathematical Studies,
  J\'anos Bolyai Mathematical Society, Budapest, 1993, pp.~317--346.

\bibitem{rodl94}
\bysame, \emph{Random graphs with monochromatic triangles in every edge
  coloring}, Random Structures Algorithms \textbf{5} (1994), no.~2, 253--270.
  \MR{95a:05102}

\bibitem{RodlRucinski95}
\bysame, \emph{Threshold functions for {R}amsey properties}, J. Amer. Math.
  Soc. \textbf{8} (1995), no.~4, 917--942. \MR{96h:05141}

\bibitem{roedl97:_rado}
\bysame, \emph{Rado partition theorem for random subsets of integers}, Proc.
  London Math. Soc. (3) \textbf{74} (1997), no.~3, 481--502. \MR{98d:05147}

\bibitem{roedl98:_ramsey}
\bysame, \emph{Ramsey properties of random hypergraphs}, Journal of
  Combinatorial Theory, Series A \textbf{81} (1998), no.~1, 1--33.
  \MR{98m:05175}

\bibitem{roedl00:_ramsey}
Vojt{\v{e}}ch R{\"o}dl and Endre Szemer{\'e}di, \emph{On size {R}amsey numbers
  of graphs with bounded degree}, Combinatorica \textbf{20} (2000), no.~2,
  257--262. \MR{1 767 025}

\bibitem{spencer88:_three}
Joel Spencer, \emph{Three hundred million points suffice}, J. Combin. Theory
  Ser. A \textbf{49} (1988), no.~2, 210--217. \MR{90b:05116a}

\bibitem{spencer89:_errat}
\bysame, \emph{Erratum: ``{T}hree hundred million points suffice''}, J. Combin.
  Theory Ser. A \textbf{50} (1989), no.~2, 323. \MR{90b:05116b}

\bibitem{szemeredi76}
Endre Szemer{\'e}di, \emph{Regular partitions of graphs}, Probl\`emes
  combinatoires et th\'eorie des graphes (Colloq. Internat. CNRS, Univ. Orsay,
  Orsay, 1976), CNRS, Paris, 1978, pp.~399--401. \MR{81i:05095}

\bibitem{thomason87}
A.~G. Thomason, \emph{Pseudorandom graphs}, Random graphs '85 ({P}ozna\'n,
  1985), North-Holland Math. Stud., vol. 144, North-Holland, Amsterdam--New
  York, 1987, pp.~307--331.

\bibitem{thomason87:_random}
\bysame, \emph{Random graphs, strongly regular graphs and pseudorandom graphs},
  Surveys in Combinatorics~1987 (C.~Whitehead, ed.), London Mathematical
  Society Lecture Note Series, vol. 123, Cambridge University Press,
  Cambridge--New York, 1987, pp.~173--195.

\end{thebibliography}

\end{document}

% Local Variables: 
% mode: latex
% eval: (setq Portug-mode nil)
% TeX-master: t
% End: 
