text:
\section{Introduction}

In this paper we study a new connection between constant-cost randomized\footnote{In this paper,
randomized communication is always in the \emph{public-coin, two-way} model; see
\cref{def:communication protocol}.} communication and a long-standing question about \emph{implicit
graph representations} in structural graph theory \cite{KNR92,Spin03}. Randomized communication is a
central topic in communication complexity \cite{GPW18,CLV19,PSW20,HHH21eccc}, and the most basic
question is, \emph{Does a given problem have a randomized protocol with only constant cost?} For
example, the \textsc{Equality} problem has constant cost \cite{NK96}, while the
\textsc{Greater-Than} problem\footnote{$\textsc{Equality}(x,y) = 1$ if and only if $x=y$.
\textsc{Greater-Than} takes value 1 on inputs $i,j \in [n]$ iff $i \leq j$.} has non-constant cost.
What are the conditions for a communication problem to have a constant-cost protocol? We show that
this question is intimately related to the existence implicit graph representations, which are the subject of a
large body of research in graph theory (\eg \cite{KM12,ACLZ15,BGK+21a,DEG+21}), but which has seen
limited progress towards the main open problem: a characterization of the hereditary graph
families that admit adjacency labeling schemes of size $O(\log n)$. We argue that  constant-cost
communication is the \emph{probabilistic} version of this question, and should therefore be studied
in parallel.

To formally state these questions, we define the following.  A hereditary graph family $\ensuremath{\mathcal{F}}$ is a
set of (labeled) graphs, closed under isomorphism and under taking induced subgraphs.  Write $\ensuremath{\mathcal{F}}_n$
for the set of graphs in $\ensuremath{\mathcal{F}}$ with vertex set $[n]$. A universal graph for $\ensuremath{\mathcal{F}}$ is a sequence
$U = (U_n)_{n \in \ensuremath{\mathbb{N}}}$ of graphs where $U_n$ contains all $G \in \ensuremath{\mathcal{F}}_n$ as induced subgraphs; the function $n
\mapsto |U_n|$ is the \emph{size} of $U$. A universal graph of size $\poly(n)$ is equivalent to an
$O(\log n)$-size \emph{adjacency labeling scheme}, which assign labels to the vertices of $G \in
\ensuremath{\mathcal{F}}$ such that adjacency between $x$ and $y$ can be determined from their labels without knowing $G$
\cite{KNR92}.

\begin{question}[Implicit Graph Question (IGQ)]
Which hereditary graph families $\ensuremath{\mathcal{F}}$ admit a universal graph of
size $\poly(n)$ (\ie an $O(\log n)$ adjacency labeling scheme)?
\end{question}

We introduce a probabilistic version of this question, which replaces adjacency labeling schemes and
universal graphs with \emph{randomized} adjacency labeling schemes (which we call \emph{adjacency
sketches}) and \emph{probabilistic universal graphs (PUGs)}. These were studied recently in
\cite{Har20} and some earlier (independent\footnote{The results of \cite{Har20} were obtained before
the author became aware of \cite{FK09}.}) results for trees appeared in \cite{FK09}; see
\cref{def:pug,def:sketch}. We are interested in the families that admit \emph{constant-size}
adjacency sketches (equivalently, constant-size PUGs).

\begin{question}[PUG Question]
\label{question:main} Which hereditary graph families $\ensuremath{\mathcal{F}}$ admit a PUG of constant size (\ie a
constant-size adjacency sketch)?
\end{question}

This question is interesting for three main reasons. First, we think it is a natural question, and
it is surprising that a rich variety of graph families can be randomly projected into a
\emph{constant-size} universal graph. Second, a simple derandomization argument shows that any
family $\ensuremath{\mathcal{F}}$ with a constant-size adjacency sketch also admits a size $O(\log n)$ adjacency labeling
scheme, so positive examples to this question are also positive examples to the IGQ.  And third,
answering this question is equivalent to identifying all (total, Boolean-valued) communication
problems with constant-cost randomized protocols. We briefly discuss these connections and our
results below.\\

\noindent\textbf{The connections:}
We refer to hereditary graph families with universal graphs of size $\poly(n)$ as \emph{positive
examples to the IGQ}. In \cref{section:correspondence} we show that constant-cost communication
problems correspond exactly to a certain subset of positive examples to the IGQ. Briefly, this
correspondence is as follows. We map any communication problem $f$ to a \emph{hereditary} graph
family $\mathfrak{F}(f)$, such that $f$ has a constant-cost protocol if and only if
$\mathfrak{F}(f)$ has a constant-size PUG (\ie a constant-size adjacency sketch).  If
$\mathfrak{F}(f)$ has a constant-size PUG, then a derandomization argument shows that it is a
positive example to the IGQ (\cref{prop:correspondence 1}). On the other hand, we map any hereditary
family $\ensuremath{\mathcal{F}}$ to a communication problem $\textsc{Adj}_\ensuremath{\mathcal{F}}$ that captures the complexity of computing
adjacency in graphs from $\ensuremath{\mathcal{F}}$, where $\textsc{Adj}_\ensuremath{\mathcal{F}}$ has a constant-cost protocol if and only if $\ensuremath{\mathcal{F}}$
has a constant-size PUG.  We emphasize that constant-cost communication problems always correspond
to positive examples to the IGQ, so to determine the conditions for constant-cost communication, it
suffices to consider the hereditary families with $O(\log n)$-size adjacency labeling schemes. In
particular, \cite{KNR92} observed that these families have \emph{factorial speed}. The speed of a
graph family $\ensuremath{\mathcal{F}}$ is the function $n \mapsto |\ensuremath{\mathcal{F}}_n|$. The hereditary families with speed
$2^{\Theta(n \log n)}$ are called \emph{factorial} \cite{SZ94,Ale97,BBW00}. So, to understand
constant-cost communication, we can restrict our attention to the factorial families of graphs.\\

\noindent\textbf{This paper:} We initiate the study of \cref{question:main}. From earlier work on
PUGs \cite{Har20} (which did not focus on the constant-size regime), we know that the set of
families with constant-size PUGs is non-trivial: \eg it includes the planar graphs but excludes the
interval graphs. Our contributions are as follows.  See \cref{section:results} for a more detailed
discussion.
\begin{enumerate}[itemsep=0em,leftmargin=1.75em]
\item We study an extensive and diverse list of families $\ensuremath{\mathcal{F}}$ that are important in the literature
on the IGQ and resolve \cref{question:main} for the set of hereditary subfamilies $\ensuremath{\mathcal{H}} \subseteq
\ensuremath{\mathcal{F}}$.  We consider monogenic bipartite families, interval graphs, permutation graphs, families of
bounded twin-width (including bounded tree- and clique-width), and many others (see
\cref{section:results}).  In each case, we find that $\ensuremath{\mathcal{H}} \subseteq \ensuremath{\mathcal{F}}$ admits a constant-size PUG
if and only if it is \emph{stable}. Stability (\eg \cite{CS18,NMP+21,GPT21}) is a property related
to \emph{monadic stability} in model theory.  Informally, a family is \emph{stable} if it does not
encode the \textsc{Greater-Than} problem; for example, planar graphs are stable while interval
graphs are not stable. Since \textsc{Greater-Than} has non-constant cost, stability is a necessary
condition in \cref{question:main}.

\item We use constant-size PUGs to find new positive examples to the IGQ. In particular, we show
that constant-size PUGs (\ie adjacency sketches) are preserved by the Cartesian product: if $\ensuremath{\mathcal{F}}$
has a constant-size PUG then so do the induced subgraphs of products of graphs in $\ensuremath{\mathcal{F}}$ (more
generally, constant-size small-distance sketches are preserved). Therefore the induced subgraphs of
any Cartesian product $G^d$ admit size $O(\log n)$ adjacency labeling schemes.  Despite the central
importance of graph products in the study of labeling schemes (\eg \cite{CLR20,DEG+21}), it was not
even known whether these families have factorial speed. This shows that PUGs are a powerful
technique even for studying deterministic adjacency labeling. In fact, we show that the above result
\emph{cannot} be obtained via some standard labeling techniques (discussed below).

\item As a consequence of our results, we obtain constant-size \emph{small-distance sketches} for
planar graphs (and more generally \emph{stable, bounded twin-width} graphs \cite{GPT21}), answering
a question of \cite{Har20}. Here we mean that for any constant $k$ and any planar graph $G$, there
is a constant-size random sketch $\mathsf{sk}$ such that $\mathsf{dist}(x,y) \leq k$ can be decided from $\mathsf{sk}(x)$,
$\mathsf{sk}(y)$ with high probability (without knowing $G$). This implies an $O(\log n)$
\emph{small-distance labeling scheme} (as in \eg \cite{ABR05}). More generally, for any
\emph{first-order formula} $\phi(x,y)$, we obtain a constant-size sketch for $\phi(x,y)$ and a
$O(\log n)$ labeling scheme for deciding $\phi$.

\item We observe that some standard techniques for designing labeling schemes are equivalent to
communication protocols with access to certain \emph{oracles}. One standard technique (\eg
\cite{KNR92,Chan18,CLR20}), which we call \emph{equality-based labeling}, is equivalent to
constant-cost deterministic communication with an \textsc{Equality} oracle, which we call
\emph{equality-based communication}. Recent work \cite{CLV19,BBM+20,PSW20,HHH21eccc} has compared
equality-based communication to randomized communication. We show that equality-based communication
cannot compute adjacency in the hypercube. Therefore, it cannot compute \textsc{$k$-Hamming
Distance} (\cite{HSZZ06,BBG14,Sag18}), and equality-based labeling cannot recover our results for
Cartesian products.
\end{enumerate}

\noindent\textbf{Discussion \& Subsequent Work.}
For every example studied in this paper, we found that stability is sufficient to guarantee
constant-size PUGs among the hereditary, factorial graph families.  Surprised that this held in the
diverse set of examples we studied, and noting that stability has a fundamental role in the
structure of hereditary graph families (see \cref{section:graph theory}), we conjectured in an early
version of this paper that this is always the case, and we considered this to be the probabilistic
version of the long-standing Implicit Graph Conjecture:\\

\noindent\textbf{Implicit Graph Conjecture} \cite{KNR92,Spin03}  A hereditary graph family $\ensuremath{\mathcal{F}}$
admits a universal graph of size $\poly(n)$ (\ie an $O(\log n)$-size adjacency labeling scheme) if
and only if it has at most factorial speed.\\

Both of these conjectures are now known to be false. The first counterexample to our PUG conjecture
was quickly provided by Hambardzumyan, Hatami, \& Hatami \cite{HHH21counter}, using an interesting
probabilistic construction from their independent and concurrent work on constant-cost communication
complexity \cite{HHH21eccc}. They show, essentially, that any ``forbidden substructure'' condition
(like stability) cannot succeed in answering our main question.  Then, by extending this
construction, Hatami \& Hatami refuted the 30-year-old Implicit Graph Conjecture itself \cite{HH21}.
Further counterexamples to our PUG conjecture include any \emph{monotone} graph family (\ie closed
under taking subgraphs) of factorial speed where the maximum number of edges in an $n$-vertex graph
is $\omega(n)$; this follows from a result in subsequent work \cite{EHK22} that any monotone family
with a constant-size PUG must have bounded arboricity. Monotone families with factorial speed and
$\omega(n)$ edges include the subgraphs of hypercubes, and the subgraphs of $K_{2,2}$-free
point-dyadic box incidence graphs studied recently in \cite{BCS+21}.

This leaves wide open both the IGQ and \cref{question:main}, which we argue should be studied in
parallel, due to the connections presented here. \cref{question:main} may be a more approachable
step towards the IGQ, because communication complexity can give lower bounds on sketches, whereas
there are not yet any lower bound techniques against labeling schemes for fixed hereditary families
of factorial speed; we hope that insights from communication complexity can be extended to provide
these. Techniques from communication complexity have also been useful to obtain positive results
on adjacency labeling where standard techniques in that field have not succeeded, in particular for
Cartesian products (in this paper and in follow-up work \cite{EHZ22}).

We also wonder why stability characterizes the existence of constant-size PUGs among so many
important families in the literature on the IGQ.  This, and the refutations of
\cite{HHH21counter,HH21}, hint at some limitations in the structure of graph families which have so
far been studied for the IGQ. \\

\noindent
\textbf{Outline.} \cref{section:correspondence} states the main concepts and the correspondence
between communication problems and hereditary graph families that motivates this paper.
\cref{section:results} states our main results.  \cref{section:preliminaries} states basic results
on PUGs. \cref{section:graph theory} reviews structural graph theory. The remaining sections prove
our results.

\subsection{Communication-to-Graph Correspondence}
\label{section:correspondence}

\begin{figure}[tbp]
	\centering
	\scalebox{.9}{\begin{tikzpicture}[
			xscale=.5,
			yscale=.6,
			every node/.style={font=\footnotesize},
	]

		\foreach 5/\x/\y in {ll/-4/-1,lr/4/-1,ul/-7/10,ur/7/10}
			{ \coordinate (5) at (\x,\y) ; }
		\foreach \s in {l,r} { \coordinate (bell-\s) at ($ (l\s)!.45!(u\s) $) ; }
		\foreach \s in {l,r} { \coordinate (abovebell-\s) at ($ (l\s)!.53!(u\s) $) ; }
		\def11{11}
		\draw[fill=black!5,thick] (ur) -- (lr) -- (ll) -- (ul) -- cycle ;

		\foreach \c/\y in {constant/0,polynomial/1,exponential/2,factorial/8.5} {
			\foreach \s in {l,r} { \coordinate (\c-\s) at ($ (l\s)!{(\y+1)/11}!(u\s) $) ; }
		}
		\fill[const-det] (exponential-r) -- (lr) -- (ll) -- (exponential-l) -- cycle ;
		\foreach \c/\y in {constant/0,polynomial/1,exponential/2,factorial/8.5} {
			\node at (0,\y-.5) {\c\ speed};
			\draw[ultra thick] (\c-l) -- (\c-r) ;
		}
		\node at (0,9.25) {superfactorial speed};
		\def0.527{0.33}

		\coordinate (cPUG-b) at ($ (exponential-l)!0.527!(exponential-r) $) ;
		\coordinate (bell-m) at ($ (bell-l)!0.527!(bell-r) $);
		\coordinate (abovebell-m) at ($ (abovebell-l)!0.527!(abovebell-r) $);
		\coordinate (um) at ($ (ul)!0.527!(ur) $);

		\draw[thick,dotted,igc-positive] (exponential-l) -- (exponential-r)
			-- ($ (exponential-r)!.55!(factorial-r)$)
			--plot[smooth,tension=.8] coordinates
				{++(0,0) ++(-2,.7) ++(-4,1.25) ++(-6,1.2) ++ (-8,2) ++(-10,2.4) ++(-11.5,2.45)
						($ (exponential-l)!.9!(factorial-l)$)}
			-- ($ (exponential-l)!.96!(factorial-l)$)
		;
		\draw[thick,dotted,const-rand] (exponential-l) -- (exponential-r)
			-- ($ (exponential-r)!.35!(factorial-r)$)
			--plot[smooth,tension=.8] coordinates
				{++(0,0) ++(-2,.5) ++(-4,.6) ++(-6,1) ++ (-8,2.5) ++ (-10,2.7) ($ (exponential-l)!.7!(factorial-l)$)}
			-- ($ (exponential-l)!.7!(factorial-l)$)
		;
		\draw[thick] (ur) -- (lr) -- (ll) -- (ul) -- cycle ;

		\foreach 5/\x/\y in {
					const-PUG/-2.2/5,
					superfac/-4/9.25
			} {
			\node[circle,fill=black,inner sep=2.2pt] (5) at (\x,\y) {};
		}
		\foreach 5/\x/\y in {planar/-2/3.5} {
			\node[circle,fill=black,inner sep=2.2pt,label=-90:{\scriptsize planar graphs}] (5) at (\x,\y) {};
		}
		\foreach 5/\x/\y in {interval/2/6.25} {
			\node[circle,fill=black,inner sep=2.2pt,label=-90:{\scriptsize interval graphs}] (5) at (\x,\y) {};
		}

		\draw[mybrace,decorate] (ll -| -5.2,0) --
				node[left=5pt,align=right,font=\scriptsize,inner sep=1pt] (subfactorial) {}
				(exponential-l -| -5.2,0) ;

		\begin{scope}[shift={(-20,4)}]
			\draw[thick,comm-problems] (0,0.5) circle [x radius=5.5,y radius=6.5];
			\draw[thick,const-rand] (0,-1.95) circle [x radius=4,y radius=4];
			\draw[thick,const-det] (0,-3.9+.25) circle [x radius=2.25,y radius=2.25];
			\foreach \l/\y in {communication\\ problems/5.5,randomized\\constant/.9,deter-\\ministic\\constant/-2.7} {
				\node[align=center] at (0,\y) {\l} ;
			}

			\foreach 5/\x/\y in {
						det-const-1/-.5/-5,%
						det-const-2/.25/-4.2,%
						mapped-planar/2/-1.2,%
						rand-const/-.2/-.5,%
						mapped-interval/.5/2.8,%
						comm-prob/-.5/4%
				} {
				\node[circle,fill=black,inner sep=2.2pt] (5) at (\x,\y) {};
			}

		\end{scope}

		\draw[mapping] (det-const-1) to[out=0,in=190] node[above] {$\mathfrak F$} (subfactorial.south) ;
		\draw[mapping] (subfactorial.north) to[out=175,in=10] node[above] {$\textsc{Adj}$} (det-const-2);
		\draw[mapping] (planar) to[bend right=10] node[above] {$\textsc{Adj}$} (mapped-planar) ;
		\draw[mapping] (rand-const) to[bend left=10] node[above] {$\mathfrak F$} (const-PUG) ;
		\draw[mapping] (interval) to[bend right=10] node[above] {$\textsc{Adj}$} (mapped-interval) ;
		\draw[mapping] (superfac) to[bend right=10] node[above] {$\textsc{Adj}$} (comm-prob) ;

	\end{tikzpicture}}
\caption{The correspondence that motivates this paper (\cref{prop:correspondence 1}).
\cref{section:graph theory} describes the lattice on the right. Communication
problems with constant-cost randomized protocols are mapped to the set of hereditary graph
families with constant-size PUGs (and therefore $\poly(n)$ universal graphs by
\cref{prop:correspondence inclusion}) by $\mathfrak{F}$.
Families with constant-size PUGs are mapped to constant-cost communication
problems by $\textsc{Adj}$.}
\label{fig:prequel}
\end{figure}

We now introduce the central communication-to-graph correspondence that motivates our work, which is
illustrated in \cref{fig:prequel} and \cref{fig:conjecture}.  For any undirected graph $G = (V,E)$,
we identify $E$ with the function $E : V \times V \to \{0,1\}$ where $E(x,y)$ holds true ($E(x,y)=1$) if
and only if $(x,y)$ is an edge of $G$. In this paper, bipartite graphs $G = (X,Y,E)$ are colored;
\ie they are defined with a fixed partition of the vertices into parts $X$ and $Y$.

A \emph{communication problem} is a sequence $f = (f_n)_{n \in \ensuremath{\mathbb{N}}}$ of functions\footnote{In the
literature, the domain is usually $\{0,1\}^n \times \{0,1\}^n$. We use $[n] \times [n]$ to highlight the
graph interpretation.} $f_n : [n] \times [n] \to \{0,1\}$.  For any communication problem $f = (f_n)_{n
\in \ensuremath{\mathbb{N}}}$, write $\CC(f_n)$ for the cost of the optimal two-way, randomized protocol
(\cref{def:communication protocol}) computing $f_n$, and write $\CC(f)$ for the function $n \mapsto
\CC(f_n)$. We may represent $f_n$ as a bipartite graph $F_n = ([n],[n],f_n)$ where $f_n$ defines the
edge relation.

We will define the hereditary family $\mathfrak{F}(f)$ associated with $f$ as the smallest
hereditary family that contains each $F_n$, as follows.  For graphs $G,H$, we write $H \sqsubset G$
if $H$ is an induced subgraph of $G$.  For any set of graphs $\ensuremath{\mathcal{G}}$, we define the \emph{hereditary
closure} $\mathsf{cl}(\ensuremath{\mathcal{G}}) \vcentcolon= \{ H : \exists G \in \ensuremath{\mathcal{G}}, H \sqsubset G \}$.  By definition, $\mathsf{cl}(\ensuremath{\mathcal{G}})$
is a hereditary graph family that includes $\ensuremath{\mathcal{G}}$. We then define
\[
  \mathfrak{F}(f) \vcentcolon= \mathsf{cl}\left( \{ F_1, F_2, \dotsc \} \right) \,.
\]
In the other direction, for any set of graphs $\ensuremath{\mathcal{F}}$, we define the natural \textsc{Adjacency}
communication problem, which captures the complexity of the two-player game of deciding
whether the players are adjacent in a given graph $G \in \ensuremath{\mathcal{F}}$. A communication problem contains only
one function $f_n$ for each input size $n$, whereas $\ensuremath{\mathcal{F}}$ contains many graphs of size $n$. The
\textsc{Adjacency} problem should capture the maximum complexity of computing adjacency in any graph
$G \in \ensuremath{\mathcal{F}}$, so for each input size $n \in \ensuremath{\mathbb{N}}$, we choose from $\ensuremath{\mathcal{F}}_n$ the graph where adjacency is
hardest to compute.  Let $\prec$ be a total order on functions $[n] \times [n] \to \{0,1\}$ that extends
the partial order $\prec'$ defined by $f_n \prec' g_n \iff \CC(f_n) < \CC(g_n)$.
We define the \textsc{Adjacency} problem as $\textsc{Adj}_\ensuremath{\mathcal{F}} = (f_n)_{n \in \ensuremath{\mathbb{N}}}$, where
\[
  f_n = \max \{ g_n : ([n], g_n) \in \ensuremath{\mathcal{F}}_n \}
\]
and the maximum is with respect to $\prec$. Here we have written $g_n : [n] \times [n] \to \{0,1\}$ for
the edge relation in the graph $([n],g_n)$. It follows that for any communication problem $f$, we have $f =
\textsc{Adj}_{\ensuremath{\mathcal{F}}}$ where $\ensuremath{\mathcal{F}} = \{ F_1, F_2, \dotsc \}$, since $\ensuremath{\mathcal{F}}_n$ is a singleton; but it is
\emph{not} true that $f = \textsc{Adj}_{\mathfrak{F}(f)}$, since for each $n \in \ensuremath{\mathbb{N}}$,
$\textsc{Adj}_{\mathfrak{F}(f)}$ effectively chooses the \emph{hardest} subproblem of size $n$ of any $f_m$ for $m \geq
n$. In this way, the map $\mathfrak{F}(f)$ has the effect of ``blowing up'' non-constant
subproblems (see \cref{example:hamming distance}), which makes it effective for studying the
constant-cost problems where this has no effect.

To proceed with the correspondence, we need \emph{probabilistic universal graphs} and
\emph{stability}.

\subsubsection{Probabilistic Universal Graphs \& Adjacency Sketches}

Universal graphs were introduced in \cite{Rado64} and \emph{adjacency labeling schemes} were
introduced in \cite{Mul89,KNR92}. As observed in \cite{KNR92}, these concepts are equivalent.  By
analogy, \cite{Har20} defined PUGs  and the equivalent \emph{randomized} adjacency labeling schemes,
which we call \emph{adjacency sketches} in this paper. (A similar definition with one-sided error is
given in \cite{FK09}; see that paper for some results on the limitations of one-sided error.) In the
field of sublinear algorithms, a \emph{sketch} reduces a large or complicated object to a smaller,
simpler one that supports (approximate) queries.  An adjacency sketch randomly reduces a hereditary
graph family to a PUG that supports adjacency queries.

\begin{definition}[Probabilistic Universal Graph]
\label{def:pug}
A \emph{probabilistic universal graph sequence} for a graph family $\ensuremath{\mathcal{F}}$ (or \emph{probabilistic
universal graph} for short) with error $\delta$ and size $m(n)$ is a sequence $U = (U_n)_{n \in
\ensuremath{\mathbb{N}}}$ of graphs with $|U_n|=m(n)$ such that, for all $n \in \ensuremath{\mathbb{N}}$ and all $G \in \ensuremath{\mathcal{F}}_n$, the
following holds: there exists a probability distribution over maps $\phi : V(G) \to V(U_n)$ such
that
\[
  \forall u,v \in V(G) : \qquad
  \Pru{\phi}{\vphantom{\Big|} \ind{(\phi(u),\phi(v)) \in E(U_n)} = \ind{(u,v) \in E(G)} } \geq 1-\delta \,.
\]
\end{definition}

\begin{definition}[Adjacency Sketch]
\label{def:sketch}
For a graph family $\ensuremath{\mathcal{F}}$, an \emph{adjacency sketch} with size $c(n)$ and error $\delta$ is a pair
of algorithms: a randomized \emph{encoder} and a deterministic \emph{decoder}. On input $G \in
\ensuremath{\mathcal{F}}_n$, the encoder outputs a (random) function $\mathsf{sk} : V(G) \to \{0,1\}^{c(n)}$. The encoder and
(deterministic) decoder $D : \{0,1\}^* \times \{0,1\}^* \to \{0,1\}$ satisfy the condition that for all $G \in
\ensuremath{\mathcal{F}}$,
\[
    \forall u,v \in V(G) : \qquad \Pru{\mathsf{sk}}{\vphantom{\Big|} D(\mathsf{sk}(u),\mathsf{sk}(v)) = \ind{(u,v) \in E(G)} } \geq
1-\delta \,.
\]
\end{definition}
In both definitions, we assume $\delta=1/3$ unless otherwise specified.  Setting $\delta=0$ we
obtain the (deterministic) labeling schemes of \cite{KNR92}.  We will write $\mathsf{SK}(\ensuremath{\mathcal{F}})$ for the
smallest function $c(n)$ such that there is an adjacency sketch for $\ensuremath{\mathcal{F}}$ with size $c(n)$ and error
$\delta=1/3$.

PUGs are equivalent to adjacency sketches, by the same argument as in \cite{KNR92}: identify the
vertices of $U_n$ with the binary strings $\{0,1\}^{c(n)}$ for $c(n) = \ceil{\log |U_n|}$, identify the
random sketch $\mathsf{sk} : V(G) \to \{0,1\}^{c(n)}$ with the map $\phi : V(G) \to V(U_n)$, and identify the
decoder $D$ with the edge relation on $U_n$. We get:

\begin{proposition}
\label{prop:pug labeling equivalence}
A hereditary family $\ensuremath{\mathcal{F}}$ has a constant-size PUG if and only if $\mathsf{SK}(\ensuremath{\mathcal{F}}) = O(1)$.
\end{proposition}

A further motivation for these objects from the perspective of communication complexity, given in
\cite{Har20}, is that adjacency sketching (respectively, labeling) is a generalization of the
randomized (resp. deterministic) \emph{simultaneous message passing (SMP)} model of communication.
In this generalization, the referee who must compute $f(x,y)$ from the messages of the players does
not know $f$ in advance; they only know a certain family $\ensuremath{\mathcal{F}}$ which contains $f$, and the players
must include sufficient information in their messages to compensate for the ignorance of the
referee. No special attention was paid in \cite{Har20} to the constant-cost regime that we study in
this paper. We use PUGs and sketches to establish the following properties of $\mathfrak{F}$ and
$\textsc{Adj}$, thereby associating constant-cost communication problems with hereditary graph families that
admit constant-size PUGs. The simple proof of this statement is in \cref{section:prelim cc}.

\begin{restatable}{proposition}{cctolabeling}
\label{prop:correspondence 1}
For any communication problem $f = (f_n)_{n \in \ensuremath{\mathbb{N}}}$ and hereditary graph family $\ensuremath{\mathcal{F}}$:
\begin{enumerate}
\item $\CC(f) = O(1)$ if and only if $\mathfrak{F}(f)$ has a constant-size PUG
(\ie $\mathsf{SK}(\mathfrak{F}(f))=O(1)$).
\item $\ensuremath{\mathcal{F}}$ has a constant-size PUG if and only if $\CC(\textsc{Adj}_\ensuremath{\mathcal{F}}) = O(1)$.
\end{enumerate}
\end{restatable}

We now connect constant-size PUGs to the IGQ.  A quantitative version of equivalence between
universal graphs and labeling schemes is as follows:

\begin{proposition}[\cite{KNR92}]
\label{prop:knr}
If a hereditary graph family $\ensuremath{\mathcal{F}}$ has a universal graph of size $2^{O(\log n)}=\poly(n)$
(\ie an adjacency labeling scheme of size $O(\log n)$), then $|\ensuremath{\mathcal{F}}_n|
\leq \binom{\poly(n)}{n} = 2^{O(n \log n)}$.
\end{proposition}

Using a derandomization result of \cite{Har20}, we see that constant-size adjacency sketches imply
adjacency labeling schemes of size $O(\log n)$ (we give a much simpler proof in
\cref{section:preliminaries}).

\begin{lemma}[\cite{Har20}]
\label{lemma:derandomization intro}
For any hereditary graph family $\ensuremath{\mathcal{F}}$, there is an adjacency labeling scheme of size
$O(\mathsf{SK}(\ensuremath{\mathcal{F}}) \cdot \log n)$.
\end{lemma}

It follows that hereditary graph families which admit constant-size PUGs are positive examples to
the IGQ, as illustrated in \cref{fig:prequel}. We refine this inclusion in \cref{section:stability}.

\begin{proposition}
\label{prop:correspondence inclusion}
If a hereditary family $\ensuremath{\mathcal{F}}$ has a constant-size PUG (\ie $\mathsf{SK}(\ensuremath{\mathcal{F}})=O(1)$) then it is a positive example to the IGQ
(\ie it admits a universal graph of size $\poly(n)$).
\end{proposition}

\subsubsection{Chain Number \& Stability}
\label{section:stability}

To refine the correspondence, we introduce the notions of \emph{chain number} and \emph{stability}.

\begin{definition}[Chain Number]
\label{def:chain number}
For a graph $G$, the \emph{chain number} $\ch(G)$ is the maximum number $k$ for which there exist
disjoint sets of vertices $\{a_1, \dotsc, a_k\}, \{b_1, \dotsc, b_k\} \subseteq V(G)$ such that
$(a_i,b_j) \in E(G)$ if and only if $i \leq j$. For a graph family $\ensuremath{\mathcal{F}}$, we write $\ch(\ensuremath{\mathcal{F}}) =
\max_{G \in \ensuremath{\mathcal{F}}} \ch(G)$.  If $\ch(\ensuremath{\mathcal{F}}) = \infty$, then $\ensuremath{\mathcal{F}}$ has \emph{unbounded chain
number}, otherwise it has \emph{bounded chain number}.
\end{definition}

As in \cite{CS18,NMP+21} we call graph families of bounded chain number \emph{stable} (they are also
called \emph{graph-theoretically stable} in \cite{GPT21}). These families have many interesting
properties, including stronger versions of Szemer{\'e}di's Regularity Lemma \cite{MS14} and the
Erd{\H o}s-Hajnal property \cite{CS18} (it is also conjectured in \cite{HHH21eccc} that graphs which
admit constant-cost protocols for adjacency satisfy the \emph{strong} Erd{\H o}s-Hajnal property),
and they play a central role in algorithmic graph theory \cite{GPT21}.  The present paper shows that
stability is also essential for understanding the IGQ and randomized communication complexity.

This is clearly illustrated by the \textsc{Greater-Than} problem, which is defined as
$\mathrm{GT}_n : [n] \times [n] \to \{0,1\}$, where $\mathrm{GT}_n(x,y) = 1$ if and only if $x \leq y$.
It is straightforward to check that, if a hereditary family $\ensuremath{\mathcal{F}}$ has unbounded chain number, then
the \textsc{Greater-Than} problem on domain $[n]$ can be reduced to the problem of computing
adjacency in some graph $G \in \ensuremath{\mathcal{F}}_{2n}$. Using known bounds on the communication
complexity of \textsc{Greater-Than} (in the \emph{simultaneous message passing} model; see
\cref{section:preliminaries}), we may then conclude:

\begin{restatable}{proposition}{lowerbound}
\label{prop:lower bound}
If a hereditary graph family $\ensuremath{\mathcal{F}}$ is not stable, then $\mathsf{SK}(\ensuremath{\mathcal{F}}) = \Omega(\log n)$.
\end{restatable}

This is proved formally in \cref{section:prelim cc}.  Therefore, for a hereditary graph family
$\ensuremath{\mathcal{F}}$ to have a constant-size PUG, it is necessary that it has bounded chain number, \ie it is
stable. In other words, if $f$ is any communication problem with $\CC(f)=O(1)$ then
$\mathfrak{F}(f)$ is stable.

\begin{figure}[tbp]
	\centering
	\scalebox{.9}{\begin{tikzpicture}[
			xscale=.5,
			yscale=.6,
			every node/.style={font=\footnotesize},
	]

		\foreach 5/\x/\y in {ll/-4/-1,lr/4/-1,ul/-7/10,ur/7/10}
			{ \coordinate (5) at (\x,\y) ; }
		\foreach \s in {l,r} { \coordinate (bell-\s) at ($ (l\s)!.45!(u\s) $) ; }
		\foreach \s in {l,r} { \coordinate (abovebell-\s) at ($ (l\s)!.53!(u\s) $) ; }
		\def11{11}
		\draw[fill=black!5,thick] (ur) -- (lr) -- (ll) -- (ul) -- cycle ;

		\foreach \c/\y in {constant/0,polynomial/1,exponential/2,factorial/8.5} {
			\foreach \s in {l,r} { \coordinate (\c-\s) at ($ (l\s)!{(\y+1)/11}!(u\s) $) ; }
		}
		\def0.527{0.527}

		\coordinate (stable-b) at ($ (exponential-l)!0.527!(exponential-r) $) ;
		\coordinate (stable-u) at ($ (factorial-l)!0.527!(factorial-r) $) ;
		\coordinate (stable-m) at ($ (ul)!0.527!(ur) $);

		\fill[const-det] (exponential-r) -- (lr) -- (ll) -- (exponential-l) -- cycle ;

		\begin{pgfonlayer}{foreground}
			\draw[ultra thick,shorten >=-2em] (stable-b) -- (stable-m);
			\foreach \c/\y/\col in {constant/0/black!30,polynomial/1/black!30,exponential/2/black!30,factorial/7.1/black!5} {
				\node at (0,\y-.5) {\c\ speed}
				\draw[ultra thick] (\c-l) -- (\c-r) ;
			}
			\node at (0,9.25) {\nodetextbeforebg{black!5}{superfactorial speed}};
			\node at (0,7.1-.5) {\nodetextbeforebg{black!5}{factorial speed}};
		\end{pgfonlayer}

		\node[yshift=1em] at ($ (ul)!.5!(stable-m) $) {stable} ;
		\node[yshift=1em] at ($ (ur)!.5!(stable-m) $) {not stable} ;

		\draw[thick,densely dotted,igc-positive] (stable-b) -- (exponential-r)
			-- ($ (exponential-r)!.4!(factorial-r)$)
			--plot[smooth,tension=.8] coordinates
				{++(0,0) ++(-1.5,1) ++(-3.5,1.7)
						($ (stable-b)!.6!(stable-u) $) }
			-- ($ (stable-b)!.8!(stable-u) $)
		;
		\draw[thick,densely dotted,const-rand] (exponential-l) -- (stable-b)
			-- ($ (stable-b)!.55!(stable-u)$)
			--plot[smooth,tension=.8] coordinates
				{++(0,0) ++(-2,-.25) ++(-4,.6) ++(-5.5,.8) ($ (exponential-l)!.65!(factorial-l)$)}
			-- ($ (exponential-l)!.75!(factorial-l)$)
		;

		\draw[thick,densely dotted,igc-negative]
			($(stable-b)!0.93!(stable-u)$) --plot[smooth,tension=.5] coordinates {
				++(-2,.1) ++(-4,.25) ++(-6,-.1)
				++(-6,-.5)
				++(-4.5,-1) ++(-2,-1.1) ++(-1,-1)
				++(0,-.9)
			}
			--cycle;
		;
		\draw[thick,densely dotted,pug-negative]
			($(stable-b)!0.89!(stable-u)$) --plot[smooth,tension=.7] coordinates {
				++(0,0) ++(-1.5,0) ++(-1.5,-0.4)
				++(2,-.4) ++(1.6,0)
				++(0,0)
			}
			--cycle;
		;

		\node[align=left,anchor=west] at ($(exponential-r)!.2!(factorial-r)$) {~$\poly(n)$ universal\\graphs (IGQ positive)} ;
		\node[align=right,anchor=east] at ($(exponential-l)!.375!(factorial-l)$) {const PUG} ;

		\draw[thin] (4.1+2.5,7.55)  node[inner sep=0pt,align=left,anchor=west]
				{~~no $\poly(n)$ \\~universal\\ graph} -- ++(-4.5,0) ;
		\draw[thin] (-4.6-2.2,7.75) node[align=right,anchor=east] {no const PUG} -- ++(+1.5,0)  ;

		\draw[thick] (ur) -- (lr) -- (ll) -- (ul) -- cycle ;

		\foreach 5/\x/\y in {
					const-PUG/-2.2/5
			} {
			\node[circle,fill=black,inner sep=2.2pt] (5) at (\x,\y) {};
		}
		\foreach 5/\x/\y in {planar/-2/3.5} {
			\node[circle,fill=black,inner sep=2.2pt,label=-90:{\scriptsize planar graphs}] (5) at (\x,\y) {};
		}
		\foreach 5/\x/\y in {interval/3/5} {
			\node[circle,fill=black,inner sep=2.2pt,label=-90:{\scriptsize interval graphs}] (5) at (\x,\y) {};
		}

		\draw[mybrace,decorate] (ll -| -5.2,0) --
				node[left=5pt,align=right,font=\scriptsize,inner sep=1pt] (subfactorial) {}
				(exponential-l -| -5.2,0) ;

		\begin{scope}[shift={(-20,4)}]
			\draw[thick,comm-problems] (0,0.5) circle [x radius=5.5,y radius=6.5];
			\draw[thick,const-rand] (0,-1.95) circle [x radius=4,y radius=4];
			\draw[thick,const-det] (0,-3.9+.25) circle [x radius=2.25,y radius=2.25];
			\foreach \l/\y in {communication\\ problems/5.5,randomized\\constant/.9,deter-\\ministic\\constant/-2.7} {
				\node[align=center] at (0,\y) {\l} ;
			}

			\foreach 5/\x/\y in {
						det-const-1/-.5/-5,%
						det-const-2/.25/-4.2,%
						mapped-planar/2/-1.2,%
						rand-const/-.2/-.5%
				} {
				\node[circle,fill=black,inner sep=2.2pt] (5) at (\x,\y) {};
			}

		\end{scope}

		\draw[mapping] (det-const-1) to[out=0,in=190] node[above] {$\mathfrak F$} (subfactorial.south) ;
		\draw[mapping] (subfactorial.north) to[out=175,in=10] node[above] {$\textsc{Adj}$} (det-const-2);
		\draw[mapping] (planar) to[bend left=5] node[above] {$\textsc{Adj}$} (mapped-planar) ;
		\draw[mapping] (rand-const) to[bend left=15] node[above] {$\mathfrak F$} (const-PUG) ;

	\end{tikzpicture}}
\caption{The stability condition partitions the factorial layer. Stable families fall under
\cref{question:main}, while the remaining factorial families fall under the IGQ.
The red regions indicate the existence of graph families with the stated property (thus proving that
the green resp.\ cyan regions do not fill the entire region of factorial graph families).
}
\label{fig:conjecture}
\end{figure}

We can now state a refined communication-to-graph correspondence, illustrated in
\cref{fig:conjecture}. It states that the constant-cost communication problems are equivalent to the
hereditary graph families $\ensuremath{\mathcal{F}}$ that admit a constant-size PUG, which is a set of positive examples
to the IGQ that are stable.

\begin{proposition}
\label{prop:correspondence stable inclusion}
If $\ensuremath{\mathcal{F}}$ has a constant-size PUG (\ie $\mathsf{SK}(\ensuremath{\mathcal{F}}) = O(1)$) then $\ensuremath{\mathcal{F}}$ is stable, and it is a positive
example to the IGQ (\ie $|\ensuremath{\mathcal{F}}_n| = 2^{O(n \log n)}$ and it admits a universal graph of size
$\poly(n)$).
\end{proposition}

We conclude this section with a useful characterization of stable graph families via forbidden
induced subgraphs. It is a well-known fact that any hereditary graph family can be defined by its
set of \emph{minimal forbidden induced subgraphs}. That is, for any hereditary family $\ensuremath{\mathcal{F}}$, there
is a \emph{unique minimal} set of graphs $\ensuremath{\mathcal{H}}$ such that $\ensuremath{\mathcal{F}}$ is the family \emph{$\ensuremath{\mathcal{H}}$-free} graphs, \ie $\ensuremath{\mathcal{F}} = \mathsf{Free}(\ensuremath{\mathcal{H}})$, where
\[
  \mathsf{Free}(\ensuremath{\mathcal{H}}) \vcentcolon= \{ G : \forall H \in \ensuremath{\mathcal{H}}, H \not\sqsubset G \} \,.
\]

One can show (\cref{prop:ch-finite-iff-no-chainlike}) that a graph family $\ensuremath{\mathcal{F}}$ has a bounded chain number
(\ie $\ensuremath{\mathcal{F}}$ is stable) if and only if
$$
	\ensuremath{\mathcal{F}} \subseteq \mathsf{Free}(H^{\circ\circ}_p, H^{\bullet\circ}_q, H^{\bullet\bullet}_r) \text{, for some choice of $p,q,r$,}
$$
where $H^{\circ\circ}_p$ is a \emph{half-graph}, $H^{\bullet\circ}_q$ is a \emph{co-half-graph}, and $H^{\bullet\bullet}_r$ is a \emph{threshold graph} (\cref{def:chain-like graphs}, depicted in \cref{fig:half graphs}).
For any $\ensuremath{\mathcal{F}}$, we denote by $\mathsf{stable}(\ensuremath{\mathcal{F}})$ the set of all stable subfamilies of $\ensuremath{\mathcal{F}}$.

\begin{figure}[thb]
	\centering
	\begin{tikzpicture}[scale=.6]

		\def5{5}
		\begin{scope}
			\foreach \i/\ab/3}\def\p{5 in {1/a/left,2/b/right} {
				\foreach \x in {1,...,5} {
					\node[vertex,label={3}\def\p{5:$\ab_\x$}] (\ab\x) at (2*\i-2,-0.75*\x){} ;
				}
			}
			\foreach \i in {1,...,5} {
				\foreach \j in {1,...,5} {
					\ifthenelse{\i < \j \OR \i = \j}{\draw (a\i) to (b\j) ;}{}
				}
			}
			\node at (1,0) {$H_5^{\circ\circ}$} ;
		\end{scope}

		\begin{scope}[shift={(6,0)}]
			\foreach \i/\ab/3}\def\p{5 in {1/a/left,2/b/right} {
				\foreach \x in {1,...,5} {
					\node[vertex] (\ab\x) at (2*\i-2,-0.75*\x){} ;
				}
			}
			\foreach \i in {1,...,5} {
				\foreach \j in {1,...,5} {
					\ifthenelse{\i < \j \OR \i = \j}{\draw (a\i) to (b\j) ;}{}
				}
			}
			\foreach \i in {1,...,5} {
				\foreach \j in {1,...,5} {
					\ifthenelse{\i<\j}{
						\draw (a\j) to[bend left=40] (a\i) ;
					}{}
				}
			}
			\node at (1,0) {$H_5^{\bullet\circ}$} ;
		\end{scope}

		\begin{scope}[shift={(12,0)}]
			\foreach \i/\ab/3}\def\p{5 in {1/a/left,2/b/right} {
				\foreach \x in {1,...,5} {
					\node[vertex] (\ab\x) at (2*\i-2,-0.75*\x){} ;
				}
			}
			\foreach \i in {1,...,5} {
				\foreach \j in {1,...,5} {
					\ifthenelse{\i < \j \OR \i = \j}{\draw (a\i) to (b\j) ;}{}
				}
			}
			\foreach \ab/3}\def\p{5 in {a/left,b/right} {
				\foreach \i in {1,...,5} {
					\foreach \j in {1,...,5} {
						\ifthenelse{\i<\j}{
							\draw (\ab\j) to[bend 3}\def\p{5=40] (\ab\i) ;
						}{}
					}
				}
			}
			\node at (1,0) {$H_5^{\bullet\bullet}$} ;
		\end{scope}
	\end{tikzpicture}
	\caption{%
		Examples of the half-graph, co-half-graph, and threshold graphs.
	}
	\label{fig:half graphs}
\end{figure}

\subsection{Example}
\label{section:examples}
While the interpretation of a communication problem (\ie Boolean matrix) as a graph is standard, the
further step of constructing a \emph{hereditary graph family} is especially useful for studying
\emph{constant-cost} communication, since a constant-cost protocol is inherited by induced subgraphs
(submatrices).  Before stating our results, we give an example to clarify the communication-to-graph
correspondence and the nuances of hereditary graph families.

\begin{example}
\label{example:hamming distance}
The \textsc{$k$-Hamming Distance} problem $\mathrm{HD}^k$ requires Alice and Bob to decide whether
the Hamming distance between their inputs $x,y \in \{0,1\}^d$ is at most $k(d)$. It has complexity
$\Theta(k(d) \log k(d))$ when $k(d) = o(\sqrt d)$ \cite{HSZZ06,Sag18}. By choosing $k(d)$
appropriately, we get a hierarchy of communication problems of various complexities. But for any
non-constant $k(d)$, the hereditary graph family $\mathfrak{F}(\mathrm{HD}^k)$ has sketch size
$\Omega(\log n)$, because it has unbounded chain number. We show that for every $t \in \ensuremath{\mathbb{N}}$ we can
choose $d$ sufficiently large to construct disjoint sets $\{a^{(1)}, \dotsc, a^{(t)}\},\{b^{(1)},
\dotsc, b^{(t)}\} \subset \{0,1\}^d$ so that $\mathsf{dist}(a_i,b_j) \leq k(d)$ if and only if $i \leq j$. We
choose $d$ such that $k=k(d) \geq t$ and define $a^{(i)}_r = 1$ if and only if $r = i$ and
$b^{(j)}_r = 1$ if and only if $r > d-k+j$ or $r \leq j$.

For $i \leq j$ it holds that $a^{(i)}_i = b^{(j)}_i = 1$ while $b^{(j)}$ takes value 1 on exactly
$k-1$ other coordinates, so $\mathsf{dist}(a^{(i)}, b^{(j)}) \leq k$. On the other hand, if $i > j$ then
$a^{(i)}_i = 1, b^{(j)}_i = 0$ and $b^{(j)}$ takes value 1 on exactly $k$ other coordinates, so
$\mathsf{dist}(a^{(i)}, b^{(j)}) = k+1$.

This illustrates some subtleties of the correspondence. Write $n = 2^d$ and think of domain $\{0,1\}^d$
as $[n]=[2^d]$. Let $k(d) = \omega(1)$.  Then $\CC(\mathrm{HD}^k_n) = \Theta(k(d) \log k(d))$. The
corresponding hereditary graph family $\mathfrak{F}(\mathrm{HD}^k)$ has unbounded chain number, so
for every $m$ there is $G \in \mathfrak{F}(\mathrm{HD}^k)$ with chain number $m$. So
$\CC(\textsc{Adj}_{\mathfrak{F}(\mathrm{HD}^k)}) = \Omega(\log d) = \Omega(\log\log n)$. But for $k(d) =
\log\log\log d$, say, this is a doubly-exponential increase in complexity.
\end{example}

The above example shows how the hereditary closure in the map $\mathfrak F$ can ``blow up'' a
non-constant subproblem to full-size. It may seem reasonable to expect that this could always
happen: if a communication problem has non-constant cost, then taking the hereditary closure in this
way would blow up the ``non-constant part'' so that it becomes full size (giving a lower bound of
$\Omega(\log n)$ on the sketch size). But this is not true: Hambardzumyan, Hatami, \& Hatami
\cite{HHH21eccc,HHH21counter} construct a non-constant communication problem where any small
subproblem that we could try to ``blow up'' actually has a constant-cost protocol.

\subsection{Results}
\label{section:results}

Equipped with the correspondence in \cref{prop:correspondence 1} and \cref{prop:correspondence
stable inclusion}, we are now prepared to state our results towards \cref{question:main}. Our goal
is to characterize the set of hereditary graph families (necessarily with factorial speed) that
admit constant-size adjacency sketches (\ie constant-size PUGs); these families correspond exactly
to the constant-cost communication problems.  Most of our results are of the following form: we
choose a hereditary family $\ensuremath{\mathcal{F}}$ with factorial speed, and characterize the subfamilies of $\ensuremath{\mathcal{F}}$
that admit constant-size PUGs.  In each case, we find that these subfamilies are exactly the set
$\mathsf{stable}(\ensuremath{\mathcal{F}})$.  See \cref{fig:graph theory} for an illustration.

\resultsfigure

\paragraph*{\cref{section:graph theory}: Contextual Results.}
Our first set of results place \cref{question:main} in context of structural graph theory and
motivate our focus on stability. These results are the basis of \cref{fig:graph theory}; they are
relatively simple, relying mostly on known structural results. In particular, 6 out of the 9
\emph{minimal factorial families} are stable, and they admit constant-size PUGs;
the remaining 3 are precisely the ``chain-like graphs'', \ie
the hereditary closure $\ensuremath{\mathcal{C}}^{\circ\circ}$, $\ensuremath{\mathcal{C}}^{\bullet\circ}$, $\ensuremath{\mathcal{C}}^{\bullet\bullet}$
of the families of half-graphs, co-half-graphs resp.\ threshold graphs (\cref{def:chain-like graphs}),
which are not stable.
These 3 families $\ensuremath{\mathcal{C}}^{\circ\circ}$, $\ensuremath{\mathcal{C}}^{\bullet\circ}$, $\ensuremath{\mathcal{C}}^{\bullet\bullet}$ are also among the \emph{minimal families above the Bell numbers},
and again, all minimal families apart from these 3 are stable, and they each admit a constant-size PUG,
along with all hereditary graph families that fall below the Bell numbers.

\paragraph*{\cref{section:bipartite graphs}: Bipartite Graphs.} The map $\mathfrak{F}$ transforms a
communication problem into a hereditary family of \emph{bipartite} graphs. Any hereditary family of
graphs can be transformed into a hereditary family of bipartite graphs, in a way which preserves
constant-size PUGs, so it is sufficient to study bipartite graphs to answer \cref{question:main}.
Since any hereditary family of bipartite graphs can be defined by forbidding a set $\ensuremath{\mathcal{H}}$ of
bipartite graphs, a natural step towards studying \cref{question:main} for bipartite graph families
is to study it for the \emph{monogenic} bipartite graph families where $\ensuremath{\mathcal{H}}$ is a singleton.

\begin{restatable}{theorem}{thmbipartite}
\label{thm:bipartite monogenic}
Let $H$ be a bipartite graph such that the family of $H$-free bipartite graphs is factorial. Then
any hereditary subfamily $\ensuremath{\mathcal{F}}$ of the $H$-free bipartite graphs has a constant-size PUG if and only
if $\ensuremath{\mathcal{F}}$ is stable.
\end{restatable}

To prove this theorem, we require new structural results for some families of bipartite graphs.
Previous work \cite{All09,LZ17} has shown that a family of $H$-free bipartite graphs is factorial
only when $H$ is an induced subgraph of $P_7, S_{1,2,3}$, or one of the infinite set
$\{F^*_{p,q}\}_{p,q \in \ensuremath{\mathbb{N}}}$ (defined in \cref{section:bipartite graphs}). We construct a new
decomposition scheme for the $F^*_{p,q}$-free graphs whose depth is controlled by the chain number,
and we show that the chain number controls the depth of the decomposition from  \cite{LZ17} for $P_7$-free graphs.

As a result, we get a $\poly(n)$-size universal graph for any stable subfamily of the $P_7$-free
bipartite graphs. The $P_7$-free bipartite graphs are a factorial family, but existence of a
$\poly(n)$-size universal graph for this family is not known.
We take this as evidence that, independent of randomized communication, the study of stable graph families
might allow progress on the IGQ.

We remark that, under a conjecture of \cite{LZ17}, if our theorem was proved for the families of
bipartite graphs obtained by excluding only \emph{two} graphs $H_1,H_2$, it would establish that
stability is characteristic of the constant-PUG factorial families of bipartite graphs that are
obtained by excluding any \emph{finite} set of induced subgraphs.

\paragraph*{\cref{section:intersection graphs}: Interval \& Permutation Graphs.}

Two typical examples of positive examples to the IGQ are the interval graphs and permutation graphs.
Interval graphs were used in \cite{Har20} as a non-trivial example where adjacency sketches must be
asymptotically as large as the adjacency labels. In our terminology, this is because interval graphs
are not stable.  Permutation graphs are also not stable, so do not admit constant-size adjacency
sketches. Our goal is to determine how much these graphs must be restricted before they admit
constant-size adjacency sketches (\ie PUGs).

\begin{restatable}{theorem}{thmintersection}
\label{thm:intersection}
Let $\ensuremath{\mathcal{F}}$ be any hereditary subfamily of interval or permutation graphs. Then $\ensuremath{\mathcal{F}}$ admits a
constant-size PUG if and only if $\ensuremath{\mathcal{F}}$ is stable.
\end{restatable}

This proof requires new structural results for interval and permutation graphs\footnote{A weaker
version of our permutation graph result (without an explicit bound on the sketch size)
also follows by our result for bounded twin-width combined with \cite{BKTW20}. We keep our
direct proof because: it gives an explicit bound on the sketch size; it is much clearer than the
twin-width result; the decomposition scheme may be of independent interest; and it was proved
independently of \cite{GPT21}, which we use for our twin-width result.}. We show that any stable
subfamily of interval graphs can be reduced to a family with bounded treewidth, and therefore has a
constant-size PUG (implied by \cref{lemma:arboricity}).  A consequence of our proof is that stable
subfamilies of interval graphs have bounded twin-width (which is not true for general interval
graphs \cite{BKTW20}).  For permutation graphs, we give a new decomposition scheme whose depth can
be controlled by the chain number.

\paragraph*{\cref{section:cartesian product}: Cartesian Products.}
Denote by $G \mathbin\square H$ the Cartesian product of $G$ and $H$, and write $G^{\square d}$ for
the $d$-wise product of $G$. For example, $P_2^{\square d}$ is the hypercube. Although Cartesian
products are extremely well-studied (\eg see \cite{CLR20} for results on universal graphs for
subgraphs of products), it was not previously known whether the number of unique induced subgraphs
of Cartesian products $G^{\square d}$ is at most $2^{O(n \log n)}$, let alone whether they are
positive examples to the IGQ. We resolve this question by proving that Cartesian products preserve
constant-size PUGs and distance-$k$ sketches (which compute $\mathsf{dist}(x,y) \leq k$). Write $\ensuremath{\mathcal{F}}^\square
\vcentcolon= \{ G_1 \mathbin\square \dotsm \mathbin\square G_d : d \in \ensuremath{\mathbb{N}}, G_i \in \ensuremath{\mathcal{F}} \}$.

\begin{restatable}{theorem}{thmgraphproducts}
\label{thm:cartesian products}
If $\ensuremath{\mathcal{F}}$ is any family that admits a constant-size PUG (including any finite family),
then $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ admits a constant-size PUG. For any fixed $k$, if $\ensuremath{\mathcal{F}}$ admits a
constant-size distance-$k$ sketch, then so does $\ensuremath{\mathcal{F}}^\square$.
\end{restatable}

This implies that $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ is a positive example to the IGQ whenever $\ensuremath{\mathcal{F}}$ admits a
constant-size PUG (\eg when $\ensuremath{\mathcal{F}}$ is finite), and that for any constant $k$ there is a deterministic
$O(\log n)$ labeling scheme for deciding $\mathsf{dist}(x,y) \leq k$ in $\ensuremath{\mathcal{F}}^\square$, whenever $\ensuremath{\mathcal{F}}$ admits
a constant-size distance-$k$ sketch. Other common graph products -- the strong, direct, and
lexicographic products (see \eg \cite{HIK11}) -- either admit trivial constant-size PUGs or have
unbounded chain number. We remark that follow-up work \cite{EHZ22} simplifies and extends our
technique from this section to obtain optimal adjacency labels for subgraphs of Cartesian products,
improving upon the results of \cite{CLR20}.

\paragraph*{\cref{section:equality}: Equality-Based Communication \& Labeling.} The
\textsc{Equality} problem is the standard example of a constant-cost communication problem
~\cite{NK96,RY20}. Recent work \cite{CLV19} asked whether efficient (\ie $\poly(\log\log n)$ on
domain $[n]$) randomized communication can always be simulated by an efficient deterministic
protocol with access to an \textsc{Equality} oracle; we call such protocols \emph{equality-based}
(see also~\cite{PSW20,BBM+20,HHH21eccc}). \cite{CLV19} gave a problem that admits an $O(\log\log n)$
randomized protocol, but any equality-based protocol has cost $\Omega(\log n)$. This leaves open the
natural question of whether \emph{constant-cost} protocols can be simulated by the \textsc{Equality}
oracle. We show\footnote{After preparation of this manuscript, we found that this result was also
proved independently with a very different Fourier-analytic technique in the recent preprint
\cite{HHH21eccc}.} there is no constant-cost equality-based protocol for adjacency in the hypercube
$P_2^n$; \ie there is no equality-based protocol for \textsc{1-Hamming Distance}, so the
\textsc{Equality} oracle cannot simulate the \textsc{$k$-Hamming Distance} protocol
~\cite{HSZZ06,BBG14,Sag18}.

\begin{restatable}{theorem}{thmequalitycc}
\label{thm:intro equality}
There is no constant-cost equality-based protocol for computing adjacency in $P_2^n$.
\end{restatable}

An interesting connection is that equality-based communication corresponds to a standard type of
adjacency labeling scheme (\eg \cite{KNR92,CLR20}; \cite{Chan18} defines a weaker type), which we
call \emph{equality-based labeling} (\cref{def:equality labeling}). All labeling schemes given in
this paper are of this type, except (by necessity) for Cartesian products. Informally, labels are
constructed as a question-and-answer series: for each question, a partition $\ensuremath{\mathcal{P}}$ of vertices is
chosen in advance. The label for $x$ asks ``Does $y$ belong to $P \in \ensuremath{\mathcal{P}}$?'', and the label for $y$
gives the answer. An example is the simple scheme for the family of forests: $\ensuremath{\mathcal{P}}$ is the partition
into singletons, and the label for $x$ asks ``Is $y$ the parent of $x$?'' and the label for $y$ asks
``Is $x$ the parent of $y$''? Our correspondence also gives a simple proof (\cref{prop:eq labeling
implies stable}) that equality-based labeling fails for any family that is not stable.

\paragraph*{\cref{section:twin-width}: Twin-Width \& Distance Sketching.}
Graph width parameters like treewidth \cite{robertson1986graph} and clique-width
\cite{courcelle1993handle} are a central tool in structural graph theory. Often, graph families
where a certain width parameter is bounded possess favorable structural, algorithmic, or
combinatorial properties.  The powerful \emph{twin-width} parameter, introduced recently in
\cite{BKTW20}, generalizes treewidth and clique-width and has attracted a lot of recent
attention \cite{GPT21,schidler2021sat,ahn2021bounds,balaban2021twin,simon2021ordered}.
Graph families of bounded twin-width are positive examples to the IGQ \cite{BGK+21a},
making them a natural choice for studying \cref{question:main}. Building upon recent structural
results on stable families of bounded twin-width \cite{GPT21}, we prove:

\begin{restatable}{theorem}{thmtwinwidth}
\label{thm:twin width}
Let $\ensuremath{\mathcal{F}}$ be a hereditary family of graphs with bounded twin-width. Then $\ensuremath{\mathcal{F}}$ admits a
constant-size PUG if and only if $\ensuremath{\mathcal{F}}$ is stable.
\end{restatable}

We also consider a type of sketch that generalizes adjacency and distance-$k$ sketches.  For any
\emph{first-order formula} $\phi(x,y)$ on vertex pairs (see \cref{section:twin-width}), we consider
sketches that allow to decide $\phi(x,y)$ instead of adjacency. An example is the $\mathsf{dist}(x,y) \leq
k$ formula:
\[
  \delta_k(x,y) \vcentcolon= (\exists v_1, v_2, \dotsc, v_{k-1} : (E(x,v_1) \vee x=v_1) \wedge
(E(v_1,v_2) \vee v_1=v_2) \wedge
\dotsm \wedge (E(v_{k-1},y) \vee v_{k-1}=y)) \,.
\]
Using results on \emph{first-order transductions} (a graph transformation that arises in model
theory) and their relation to stability and twin-width \cite{BKTW20,NMP+21}, we
obtain the following corollary of \cref{thm:twin width}:

\begin{corollary}
Let $\ensuremath{\mathcal{F}}$ be a stable family of bounded twin-width and let $\phi(x,y)$ be a first-order formula.
Then $\ensuremath{\mathcal{F}}$ admits a constant-size sketch for deciding $\phi$.
\end{corollary}

This gives us constant-size distance-$k$ sketches for stable families of bounded twin-width. This
answers a question of \cite{Har20}, who asked about distance-$k$ sketches for planar graphs (which
are stable, because they have bounded degeneracy, and are of bounded twin-width \cite{BKTW20}).

\section{Preliminaries}
\label{section:preliminaries}

\subsection{Notation and Terminology}
\label{section:notation}

We write $\ind{A}$ for the indicator of event $A$; \ie the function which is $1$ if and only if
statement $A$ is true. For a finite set $X$, we write $x \sim X$ when $x$ is a random variable drawn
uniformly at random from $X$.

All graphs in this work are simple, \ie undirected, without loops and multiple edges.
Let $G$ be a graph and let $v$ be a vertex in $G$.
A vertex that is adjacent to $v$ is called a \emph{neighbour} of $v$. The set of all neighbours of $v$ is called the \emph{neighbourhood} of $v$ and it is denoted as $N(v)$. The \emph{degree} of $v$ is the number of neighbours of $v$ and it is denoted as $\deg(v)$.
A bipartite graph is a graph whose vertex set can be partitioned into two independent sets.  A
\emph{colored} bipartite graph is a bipartite graph with a given bipartition of its vertex set.  We
denote a colored bipartite graph by a triple $(X,Y,E)$, where $X,Y$ is the partition of its vertex
set into two parts, and the function $E : X \times Y \to \{0,1\}$ defines the edge relation. If a
bipartite graph $G$ is connected, it has a unique partition of its vertices into two parts and
therefore there is only one colored bipartite graph corresponding to $G$;
(note that $(X,Y,E)$ and $(Y,X,E)$ are considered the same colored bipartite graph).
If $G$ is disconnected, however, there is more than one corresponding colored bipartite graph.

For colored bipartite graphs $G = (X,Y,E)$ and $H = (X',Y',E')$, we say that $H$ is an induced
subgraph of $G$, and write $H \sqsubset G$, when there is an injective map $\phi : X' \cup Y' \to X
\cup Y$ that preserves adjacency and preserves parts. The latter means that the images $\phi(X')$
and $\phi(Y')$ satisfy either $\phi(X') \subseteq X, \phi(Y') \subseteq Y$ or $\phi(X') \subseteq Y,
\phi(Y') \subseteq X$.  A colored bipartite graph $G = (X,Y,E)$ is called \emph{biclique} if every
vertex in $X$ is adjacent to every vertex in $Y$, and $G$ is called \emph{co-biclique} if $E =
\emptyset$.

For any graph $G = (V,E)$ and subset $W \subseteq V$, we write $G[W]$ for the subgraph of $G$
induced by~$W$. For disjoint sets $X,Y \subseteq V$, we write $G[X,Y]$ for the colored bipartite
graph $(X,Y,E')$ where for $(x,y) \in X \times Y$, $(x,y) \in E'$ if and only if $(x,y) \in E$.

We also write $\overline G$ for the graph complement of $G$, \ie the graph $(V,\overline E)$ where
$(x,y)\in \overline E$ if and only if $(x,y)\notin E$.  The \emph{bipartite} complement, $\bc{G}$,
of a colored bipartite graph $G=(X,Y,E)$ is the graph $\bc{G} = (X,Y,\bc{E})$ with $(x,y)\in \bc{E}$
if and only if $(x,y)\notin E$ for $x\in X$, $y\in Y$.

The \emph{disjoint union} of two graphs $G = (V, E)$ and $H = (V', E')$ is the graph $G + H = (V
\cup V', E \cup E')$.

\subsection{Communication Complexity}
\label{section:prelim cc}

We refer the reader to \cite{NK96,RY20} for an introduction to communication complexity.  For a function $f : \ensuremath{\mathcal{X}}
\times \ensuremath{\mathcal{Y}} \to \{0,1\}$, we will write $\CC(f)$ for the optimal two-way, public-coin randomized
communication cost of $f$. Informally, in this model, the players Alice and Bob share a source of
randomness. Alice receives input $x$, Bob receives input $y$, and they communicate by sending
messages back and forth using their shared randomness. After communication, Bob must output a
(random) value $b \in \{0,1\}$ such that $b = f_n(x,y)$ with probability at least $2/3$. The cost of
such a protocol is the maximum over all inputs of the number of bits communicated between the
players. Formally, the definition is as follows.

\begin{definition}
\label{def:communication protocol}
A two-way public-coin communication protocol is a probability
distribution over \emph{communication trees}.  For input size $n$, a communication tree $T_n$ is a
binary tree with each inner node being a tuple $(p,m)$ where $p \in \{A,B\}$ and $m : [n] \to \{0,1\}$,
and each edge of $T_n$ is labeled either $0$ or $1$. Each leaf node is labeled either 0 or 1. For
any fixed tree $T_n$ and inputs $x,y \in [n]$, communication proceeds by setting the current node
$c$ to the root node. At each step of the protocol, if $c$ is an inner node $(A,m)$ then Alice sends
$m(x)$ to Bob and both players set $c$ to the child along the edge labeled $m(x)$. If $c$ is an
inner node $(B,m)$ then Bob sends $m(y)$ to Alice, and both players set $c$ to the child along the
edge labeled $m(y)$.  The protocol terminates when $c$ becomes a leaf node, and the output is the
value of the leaf node; we write $T(x,y)$ for the output of communication tree $T$ on inputs $x,y$.

For communication problem $f = (f_n)_{n \in \ensuremath{\mathbb{N}}}$, a randomized protocol must satisfy $T_n(x,y) =
f_n(x,y)$ with probability at least $2/3$, where the probability is over the choice of $T_n$. The
cost of a protocol for $f_n$ is the minimum value $d$ such that all trees $T_n$ in the support of
the distribution have depth at most $d$.
\end{definition}

\cctolabeling*
\begin{proof}
First suppose that $\ensuremath{\mathcal{F}}$ is a hereditary graph family with $\mathsf{SK}(\ensuremath{\mathcal{F}})=O(1)$, and write $\textsc{Adj} =
(\textsc{Adj}_n)_{n \in \ensuremath{\mathbb{N}}}$ for the communication problem $\textsc{Adj}_\ensuremath{\mathcal{F}}$. Let $D$ be the decoder of the
constant-cost adjacency sketch, and for any graph $G \in \ensuremath{\mathcal{F}}$ write $\Phi_G$ for the distribution
over sketches for $G$. We obtain a constant-cost communication protocol for $\textsc{Adj}$ as follows. For
each $n \in \ensuremath{\mathbb{N}}$, let $G_n \in \ensuremath{\mathcal{F}}_n$ be the graph such that $\textsc{Adj}_n$ is the edge relation of $G_n$.
On inputs $x,y \in [n]$, Alice and Bob sample $\mathsf{sk} \sim \Phi_{G_n}$ and Alice sends $\mathsf{sk}(x)$ to
Bob, which requires at most $\mathsf{SK}(\ensuremath{\mathcal{F}})$ bits of communication. Then Bob simulates the decoder on
$D(\mathsf{sk}(x),\mathsf{sk}(y))$. By definition
\[
  \Pru{\mathsf{sk} \sim \Phi_G}{ \vphantom{\big|} D(\mathsf{sk}(x),\mathsf{sk}(y)) = \textsc{Adj}_n(x,y) } \geq 2/3 \,.
\]
Now suppose that $\CC(\textsc{Adj}) = O(1)$. For any $G \in \ensuremath{\mathcal{F}}_n$ it holds that the edge relation $g_n :
[n] \times [n] \to \{0,1\}$ for $G$ satisfies $\CC(g_n) \leq \CC(\textsc{Adj}_n)$, by definition. For each $G \in
\ensuremath{\mathcal{F}}$, let $\ensuremath{\mathcal{P}}(G)$ be the probability distribution over communication trees defined by an optimal
communication protocol for the edge relation of $G$. Then it holds that every communication tree in
the support of $\ensuremath{\mathcal{P}}(G)$ has depth at most $\CC(\textsc{Adj})$. So there is some $d$, such that, for every $G
\in \ensuremath{\mathcal{F}}$, all communication trees $T$ in the support of $\ensuremath{\mathcal{P}}(G)$ have depth at most $d$. We define
the adjacency sketch for $\ensuremath{\mathcal{F}}$ as follows. For every $G=(V,E) \in \ensuremath{\mathcal{F}}$, construct the random sketch
$\mathsf{sk}$ by sampling $T \sim \ensuremath{\mathcal{P}}(G)$, and then for every $v \in V$:

\begin{quote}
For every node $c$ of $T$, append to the label $\mathsf{sk}(v)$ the following:
\begin{enumerate}
  \item If $c$ is an inner node $(p,m)$ (with $p \in \{A,B\}$ and $m : [n] \to \{0,1\}$), append the
      symbol $p$ and the value $m(v)$.
  \item If $c$ is a leaf with value $b$, append the symbol $L$ and the value $b$.
\end{enumerate}
\end{quote}
We define the decoder $D$ as follows. On input $(\mathsf{sk}(u),\mathsf{sk}(v))$, the decoder simulates the
communication tree $T$ on $(u,v)$ using the values $m(u),m(v)$ for each inner node. We therefore
obtain
\[
  \Pru{\mathsf{sk}}{ D(\mathsf{sk}(u),\mathsf{sk}(v)) = E(u,v) }
  = \Pru{T \sim \ensuremath{\mathcal{P}}(G)}{ T(u,v) = E(u,v) } \geq 2/3 \,.
\]
From the first argument above, it is clear that for any communication problem $f$, if
$\mathsf{SK}(\mathfrak{F}(f)) = O(1)$ then $\CC(f) = O(1)$. In the other direction, assume that $\CC(f) \leq d$
for some constant $d$, and consider $\mathsf{SK}(\mathfrak{F}(f))$, where $\mathfrak{F}(f) = \mathsf{cl}(\{F_1, F_2,
\dotsc\})$ for the graphs $F_n$ on vertex set $[n]$ with edge relation $f_n$. Then it holds for any
$G \in \mathfrak{F}(f)$ that there exists $n \in \ensuremath{\mathbb{N}}$ such that $G \sqsubset F_n$. But then the edge
relation $g$ of $G$ satisfies $\CC(g) \leq \CC(f_n) \leq d$, since the communication problem $g$ is
a subproblem of $f_n$. We may then construct adjacency sketches by the scheme above, so we conclude $\mathsf{SK}(\mathfrak{F}(f)) = O(1)$.
\end{proof}

For the purpose of the next two statements, we briefly describe the public-coin \emph{simultaneous message passing (SMP)} model of communication.  In this model, given (private) inputs $x,y \in [n]$ to problem $f_n :
[n] \times [n] \to \{0,1\}$, Alice and Bob use shared randomness to send random messages $A(x),B(y)$ to
a third-party referee, who must output $f_n(x,y)$ with probability at least $2/3$ over the
choice of messages. The complexity of the protocol is $\max_{x,y} \max(|A(x)|, |B(y)|)$. It is known
that on domain $[n]$, the SMP complexity of \textsc{Greater-Than} is $\Theta(\log n)$ (see the
bibliographic remark in \cref{app:lower-bound-greather-than}).

\lowerbound*
\begin{proof}
This follows from the fact that an adjacency sketch for $\ensuremath{\mathcal{F}}$ can be used to construct a
communication protocol for \textsc{Greater-Than} in the public-coin SMP model of communication.  The construction is as follows. Let $D$ be the decoder for
an adjacency sketch for $\ensuremath{\mathcal{F}}$. Given inputs $x,y \in [n]$, Alice and Bob can compute
$\mathrm{GT}_n(x,y)$ in the SMP model by choosing a graph $G \in \ensuremath{\mathcal{F}}$ with $\ch(G)=n$, so there
exist disjoint sets of vertices $\{a_1, \dotsc, a_n\}, \{b_1, \dotsc, b_n\}$ such that $(a_i,b_j)$
are adjacent if and only if $i \leq j$.  Since $\ensuremath{\mathcal{F}}$ is hereditary, the induced subgraph $H
\sqsubset G$ on vertices $\{a_1, \dotsc, a_n, b_1, \dotsc, b_n\}$ is in $\ensuremath{\mathcal{F}}$. Alice and Bob draw
random sketches $\mathsf{sk}(a_x),\mathsf{sk}(b_y)$ according to the adjacency sketch for $H$, and send them to the
referee, who outputs $D(\mathsf{sk}(a_x),\mathsf{sk}(b_y))$. This communication protocol has complexity at most
$\mathsf{SK}(\ensuremath{\mathcal{F}})$, so by the lower bound on the SMP complexity of \textsc{Greater-Than}, we must have
$\mathsf{SK}(\ensuremath{\mathcal{F}}) = \Omega(\log n)$.
\end{proof}

\subsection{Boosting \& Derandomization}
\label{section:randomized labeling schemes}

Here we state some elementary facts about adjacency sketches and PUGs.

\begin{proposition}[Probability boosting]
\label{prop:boosting}
Let $\ensuremath{\mathcal{F}}$ be a family of graphs. For any $\delta \in (0,1/2)$, there is an adjacency sketch with
error $\delta$ and size at most $O(\mathsf{SK}(\ensuremath{\mathcal{F}}_n) \cdot \log\frac{1}{\delta})$.  Equivalently, if there
is a PUG $U = (U_n)$ for $\ensuremath{\mathcal{F}}$ with size $|U_n|$, then there is a PUG $U' = (U'_n)$ for $\ensuremath{\mathcal{F}}$ with
error $\delta$ and $|U'_n| \leq |U_n|^{O(\log(1/\delta))}$.
\end{proposition}
\begin{proof}
Write $s(n) \vcentcolon= \mathsf{SK}(\ensuremath{\mathcal{F}}_n)$ and let $G \in \ensuremath{\mathcal{F}}_n$. Then there is a distribution $\ensuremath{\mathcal{S}}$ over
functions $\mathsf{sk} : V(G) \to \{0,1\}^{s(n)}$ and a decoder $D : \{0,1\}^{s(n) \times s(n)} \to \{0,1\}$ satisfying
the definition of an adjacency sketch. Consider the following adjacency sketch.  Sample $\mathsf{sk}_1,
\dotsc, \mathsf{sk}_k$ independently from $\ensuremath{\mathcal{S}}$. To each vertex $x \in V(G)$ assign the label $\mathsf{sk}'(x) =
(\mathsf{sk}_1(x), \dotsc, \mathsf{sk}_k(x))$. On input $(\mathsf{sk}'(x),\mathsf{sk}'(y))$, the decoder will output
$\mathsf{majority}(D(\mathsf{sk}_1(x), \mathsf{sk}_1(y)), \dotsc, D(\mathsf{sk}_k(x),\mathsf{sk}_k(y)))$.

For each $i \in [k]$, let $X_i = 1$ if $D(\mathsf{sk}_i(x),\mathsf{sk}_i(y)) = \ind{(x,y) \in E(G)}$ and $X_i = 0$
otherwise; and let $X = \sum_{i=1}^k X_i$.  Observe that for each $i \in [k], \Ex{X_i} = \geq 2/3$,
so $\Ex{X} \geq 3k/2$. Then, by the Chernoff bound, the probability that the decoder fails is
\[
  \Pr{ X \leq k/2 }
  \leq \Pr{ X \leq \Ex{X}/3 }
  \leq e^{-\frac{k}{3}} \,.
\]
This is at most $\delta$ when $k = 3\ln(1/\delta)$.
\end{proof}

The following statement was proven in \cite{Har20}. We include a much simpler proof here for the
sake of completeness.

\begin{lemma}[Labeling derandomization]
\label{lemma:derandomization}
For any graph family $\ensuremath{\mathcal{F}}$, there is an adjacency labeling scheme with size at most
$O(\mathsf{SK}(\ensuremath{\mathcal{F}}_n) \cdot \log n)$.
\end{lemma}
\begin{proof}
Let $G \in \ensuremath{\mathcal{F}}_n$.  Using \cref{prop:boosting} for $\delta = 1/n^3$, we obtain an
adjacency sketch with error probability $\delta$ and size $c(n) = O(\mathsf{SK}(\ensuremath{\mathcal{F}}_n) \cdot
\log(1/\delta)) = O(\mathsf{SK}(\ensuremath{\mathcal{F}}_n) \cdot \log n)$. For a fixed sketch function $\mathsf{sk} : V(G) \to
\{0,1\}^{c(n)}$, write $\Delta_\mathsf{sk}$ for the number of pairs $x,y$ such that the decoder outputs the incorrect
value on input $\mathsf{sk}(x),\mathsf{sk}(y)$. Then, by the union bound, for a randomly chosen sketch function $\mathsf{sk}$,
\[
  \Ex{\Delta_\mathsf{sk}} \leq \delta \binom{n}{2} \leq 1/n \,.
\]
Then there exists a fixed $\mathsf{sk}$ with $\Delta_\mathsf{sk} \leq 1/n < 1$ so $\Delta_\mathsf{sk} = 0$; this $\mathsf{sk}$
is an adjacency labeling scheme for $G$. Furthermore, for $\mu = \Ex{\Delta_\mathsf{sk}}$, Markov's inequality gives
\[
  \Pr{ \Delta_\mathsf{sk} > 0 } = \Pr{ \Delta_\mathsf{sk} \geq 1 } = \Pr{ \Delta_\mathsf{sk} \geq n \mu}
  \leq \frac{\mu}{n \mu} = 1/n \,,
\]
so a random $\mathsf{sk}$ function is a (deterministic) adjacency labeling scheme for $G$ with probability at least $1-1/n$.
\end{proof}

\subsection{Equality-Based Labeling Schemes}

We introduce the concept of \emph{equality-based labeling schemes}. For simplicity of notation, we
write
\[
  \textsc{Eq}(a,b) = \ind{a=b} \,.
\]

\begin{restatable}{definition}{eqlabeling}(Equality-based Labeling Scheme).
\label{def:equality labeling}
Let $\ensuremath{\mathcal{F}}$ be a family of graphs. An \emph{$(s,k)$-equality-based} labeling scheme for $\ensuremath{\mathcal{F}}$ is a
labeling scheme defined as follows. For every $G \in \ensuremath{\mathcal{F}}$ with vertex set $[n]$ and every $x \in
[n]$, the label $\ell(x)$ consists of the following:
\begin{enumerate}
\item A \emph{prefix} $p(x) \in \{0,1\}^s$. If $s = 0$ we write $p(x) = \bot$.
\item A sequence of $k$ \emph{equality codes} $q_1(x), \dotsc, q_k(x) \in \ensuremath{\mathbb{N}}$.
\end{enumerate}
The decoder must be of the following form. There is a set of functions $D_{p_1,p_2} : \{0,1\}^{k \times
k} \to \{0,1\}$ defined for each $p_1,p_2 \in \{0,1\}^s$ such that, for every $x,y \in [n]$, it holds that
$(x,y) \in E(G)$ if and only if $D_{p(x),p(y)}(Q_{x,y}) = 1$, where $Q_{x,y} \in \{0,1\}^{k \times k}$
is the matrix with entries $Q_{x,y}(i,j) = \textsc{Eq}(q_i(x),q_j(y))$. If $s = 0$ we simply write
$D(Q_{x,y})$.
\end{restatable}

\begin{remark}\label{rm:conv-form}
We will often use the following notation. A label for $x$ will be written as a constant-size tree of
tuples of the form
\[
  (p_1(x), \dotsc, p_r(x) \eqLabelSep q_1(x), \dotsc, q_t(x) ) \,,
\]
where the symbols $p_i(x)$ belong to the prefix, while the symbols $q_i(x)$ are equality codes. When
$r,t$ are constants and the label consists of a constant number of tuples, it is straightforward to
put such a label into the form required by \cref{def:equality labeling}.
\end{remark}

We say that $\ensuremath{\mathcal{F}}$ admits a \emph{constant-size equality-based} labeling scheme if there exist
constants $s,k$ such that $\ensuremath{\mathcal{F}}$ admits an $(s,k)$-equality-based labeling scheme.

\begin{lemma}
\label{lemma:eq labeling}
Let $\ensuremath{\mathcal{F}}$ be any hereditary family that admits a constant-size equality-based labeling scheme. Then
$\ensuremath{\mathcal{F}}$ admits a constant-size adjacency sketch (and hence a constant-size PUG).
\end{lemma}
\begin{proof}
Suppose $\ensuremath{\mathcal{F}}$ admits an $(s,k)$-equality based labeling scheme.  We construct a constant-size adjacency sketch
for $\ensuremath{\mathcal{F}}$ as follows. For any graph $G \in \ensuremath{\mathcal{F}}_n$, observe that we may assume each equality code
$q_i(x)$ is in $[n]$, since there are at most $n$ vertices.
\begin{enumerate}
\item For each $t \in [n]$ we assign a uniformly random number $r(t) \sim [3k^2]$.
\item For each vertex $x$ assign the label $\mathsf{sk}(x) = (p(x), r(q_1(x)), \dotsc, r(q_k(x)))$.
\end{enumerate}
On input $\mathsf{sk}(x),\mathsf{sk}(y)$, the decoder constructs the matrix $R \in \{0,1\}^{k \times k}$ where
\[
R(i,j) = \textsc{Eq}( r(q_i(x)), r(q_j(y)) ) \,,
\]
and outputs
\[
  D(\mathsf{sk}(x),\mathsf{sk}(y)) = D_{p(x),p(y)}( R ) \,.
\]
It suffices to show that, for any $x,y$, we will have $R=Q_{x,y}$ with probability at least $2/3$.
By the union bound,
\[
  \Pr{ R \neq Q_{x,y} } \leq \sum_{i,j \in [k]} \Pr{ \textsc{Eq}(r(q_i(x)), r(q_j(x)) )
      \neq \textsc{Eq}(q_i(x), q_j(y)) } \,.
\]
For any $i,j$, if $q_i(x)=q_j(y)$ we will have $r(q_i(x)) = r(q_j(y))$ with probability 1. On
the other hand, if $q_i(x) \neq q_j(y)$ we have $r(q_i(x)) = r(q_j(y))$ with probability at most
$1/3k^2$. Therefore
\[
  \Pr{ R \neq Q_{x,y} } \leq k^2 \cdot \frac{1}{3k^2} = 1/3 \,. \qedhere
\]
\end{proof}
We note that, although the construction of $R$ in the above sketch has only one-sided error (\ie if
$\textsc{Eq}(q_i(x),q_j(y))=1$ then $R(i,j)=1$ with probability 1), the adjacency sketch does \emph{not}
necessarily have one-sided error. This is because the matrix $R$ is the input to an arbitrary
function.

Equality-based labeling schemes imply constant-size sketches and PUGs by the above lemma, and by
\cref{lemma:derandomization} this implies $O(\log n)$ adjacency labeling schemes and $\poly(n)$
universal graphs. However, in this particular case, the probabilistic method in
\cref{lemma:derandomization} is not necessary, since each equality code can be written with $O(\log
n)$ bits.

\begin{proposition}[Na\"ive Derandomization]
\label{prop:simple derandomization}
Let $\ensuremath{\mathcal{F}}$ be any hereditary family that admits a constant-size equality-based labeling scheme. Then
$\ensuremath{\mathcal{F}}$ admits an adjacency labeling scheme of size $O(\log n)$.
Moreover, these labels can be constructed deterministically.
\end{proposition}
\begin{proof}
Suppose $\ensuremath{\mathcal{F}}$ admits an $(s,k)$-equality based labeling scheme, for constants $s,k$. For each $G \in
\ensuremath{\mathcal{F}}_n$, we may assume that each equality code $q_i(x)$ is in $[n]$, since there are at most $n$
vertices. Therefore for every $x$ we can assign label $\ell(x) = (p(x), q_1(x), \dotsc, q_k(x))$
using at most $s + k \ceil{\log n} = O(\log n)$ bits.
\end{proof}

The following proposition shows that equality-based labeling must fail to produce $O(\log n)$-size
adjacency labeling schemes whenever the family $\ensuremath{\mathcal{F}}$ is not stable.

\begin{proposition}
\label{prop:eq labeling implies stable}
If a hereditary graph family $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based labeling scheme, then $\ensuremath{\mathcal{F}}$
is stable.
\end{proposition}
\begin{proof}
By \cref{lemma:eq labeling}, it holds that $\ensuremath{\mathcal{F}}$ has a constant-size PUG. By
\cref{prop:correspondence stable inclusion} this implies that $\ensuremath{\mathcal{F}}$ is stable.
\end{proof}

\subsection{Basic Adjacency Sketches}
\label{sec:bounded-arboricity}

Here we give some simple adjacency sketches for equivalence graphs and bounded-arboricity graphs
that we will require for our later results.

\begin{definition}
	A graph $G$ is an \emph{equivalence graph} if it is a disjoint union of cliques.  A colored bipartite graph $G =
	(X,Y,E)$ is a \emph{bipartite equivalence graph} if it is a colored disjoint union of bicliques, \ie
	if there are partitions $X = X_1 \cup \dotsm \cup X_m$, $Y = Y_1 \cup \dotsm \cup Y_m$ such that each
	$G[X_i,Y_i]$ is a biclique and each $G[X_i,Y_j]$ is a co-biclique when $i \neq j$.
\end{definition}

The equivalence graphs are exactly the $P_3$-free graphs and the bipartite equivalence graphs are exactly the
$P_4$-free bipartite graphs. The following fact is an easy exercise.

\begin{fact}\label{fact:equivalence-graphs-labeling}
The equivalence graphs and the bipartite equivalence graphs admit constant-size equality-based
labeling schemes.
\end{fact}

\begin{definition}
A graph $G = (V,E)$ has \emph{arboricity} $\alpha$ if its edges can be partitioned into at most
$\alpha$ forests.
\end{definition}

In the next lemma, we interpret the classic labeling scheme of \cite{KNR92} as an equality-based
labeling scheme, and we obtain adjacency sketches for bounded-arboricity graphs that improves
slightly upon the na\"ive bound in \cref{lemma:eq labeling} and in \cite{Har20}.

\begin{lemma}
\label{lemma:arboricity}
For any $\alpha \in \ensuremath{\mathbb{N}}$, let $\ensuremath{\mathcal{A}}$ be the family of graphs with arboricity at most $\alpha$. Then
$\ensuremath{\mathcal{A}}$ admits a constant-size equality-based adjacency labeling scheme. $\ensuremath{\mathcal{A}}$ also admits an
adjacency sketch of size $O(\alpha)$.
\end{lemma}
\begin{proof}
For any graph $G \in \ensuremath{\mathcal{A}}_n$ with vertex set $[n]$, partition the edges of $G$ into forests $F_1,
\dotsc, F_\alpha$ and to each tree in each forest, identify some arbitrary vertex as the root. For
every vertex $x$, assign equality codes $q_1(x) = x$ and for $i \in [\alpha]$ set $q_{i+1}(x)$ to be
the parent of $x$ in forest $F_i$; if $x$ is the root assign $q_{i+1}(x) = 0$.  For vertices $x,y$,
the decoder outputs
\[
  \left(\bigvee_{j = 2}^\alpha \textsc{Eq}( q_1(x), q_j(y) ) \right) \vee
  \left(\bigvee_{j = 2}^\alpha \textsc{Eq}( q_1(y), q_j(x) ) \right) \,.
\]
This is 1 if and only if $y$ is the parent of $x$ or $x$ is the parent of $y$ in some forest $F_i$.

One can apply \cref{lemma:eq labeling} to obtain an $O(\alpha \log \alpha)$ adjacency sketch. We can
improve this using a Bloom filter, since the output is simply a disjunction of equality checks. To
each $i \in [n]$, assign a uniformly random number $r(i) \sim [6\alpha]$, and to each vertex $x$
assign the sketch $(r(x), b(x))$ where $b(x) \in \{0,1\}^{6\alpha}$ satisfies $b(x)_i = 1$ if and
only if $r(q_j(x)) = i$ for some $j \in \{2, \dotsc, \alpha+1\}$. On input $(r(x), b(x))$ and
$(r(y), b(y))$, the decoder outputs 1 if and only if $b(x)_{r(y)} = 1$ or $b(y)_{r(x)} = 1$. If $y$
is a parent of $x$ in any of the $\alpha$ forests, then $y=q_j(x)$ for some $j$, so $b(x)_{r(y)} =
b(x)_{r(q_j(x))} = 1$ and the decoder will output 1 with probability 1. Similarly, if $x$ is a
parent of $y$ in any of the $\alpha$ forests, the decoder will output 1 with probability 1. The
decoder fails only when $x,y$ are not adjacent and $r(x) = r(q_j(y))$ or $r(y) = r(q_j(x))$ for some
$j$. By the union bound, this occurs with probability at most $2\alpha \cdot \frac{1}{6\alpha} =
1/3$, as desired. The size of the sketches is $O(\log(\alpha) + \alpha) = O(\alpha)$.
\end{proof}

\begin{remark}
\label{remark:treewidth}
Bounded-arboricity families include many commonly-studied hereditary graph families. Bounded
degeneracy families, bounded treewidth families, and proper minor-closed families \cite{Mad67} all
have bounded arboricity.
\end{remark}

\ignore
\begin{lemma}[\cite{Har20}]
\label{lemma:arboricity}
For any $\alpha : \ensuremath{\mathbb{N}} \to \ensuremath{\mathbb{N}}$, let $\ensuremath{\mathcal{A}}$ be the family of graphs where $\ensuremath{\mathcal{A}}_n$ has arboricity at most
$\alpha(n)$. Then $\mathsf{SK}(\ensuremath{\mathcal{A}}_n) = O(\alpha(n))$.
In particular, if $\alpha$ is constant, then $\mathsf{SK}(\ensuremath{\mathcal{A}}_n) = O(1)$.
\end{lemma}
\begin{proof}
Let $G \in \ensuremath{\mathcal{A}}_n$ and let $T_1, \dotsc, T_\alpha$ be the forests that partition $E(G)$. Assign an
arbitrary root in each tree of each forest $T_i$. The randomized adjacency labeling scheme is as
follows. Let $m = 6\alpha$. For each vertex $x$, assign a uniformly random number $c(x) \sim [m]$.
Label each vertex $x$ with $c(x)$ and a binary string $\ell(x) \in \{0,1\}^{m}$ where $\ell(x)_i = 1$ if
and only if the parent $p_j(x)$ of $x$ in some $T_j$ has $c(p(x)) = i$. On inputs $(c(x),\ell(x))$
and $(c(y),\ell(y))$ for vertices $x,y$, the decoder outputs 1 if and only if either
$\ell(x)_{c(y)}=1$ or $\ell(y)_{c(x)}=1$. This is correct with probability at least $2/3$, as
follows.

If $x,y$ are adjacent then for some $i \in [\alpha]$ either $p_i(x)=y$ or $y = p_i(x)$. In the first
case, $\ell(x)_{c(y)}=1$ and in the second case $\ell(y)_{c(x)}=1$, so the decoder outputs 1 with
probability 1.

If $x,y$ are not adjacent, then the algorithm outputs 1 only when $\ell(x)_{c(y)}=1$ or
$\ell(y)_{c(x)}=1$. If $\ell(x)_{c(y)}=1$ then for every $i \in [\alpha]$, $p_i(x) \neq y$ since
$x,y$ are not adjacent, but for some $i \in [\alpha]$ it holds that $c(p_i(x))=c(y)$.
For each $i$ this occurs with probability at most $1/m$. By the union bound, the probability that
$c(p_i(x))=c(y)$ for some $i \in [\alpha]$ is at most $\alpha/m$. Similarly, the probability that
$\ell(y)_{c(x)}=1$ is at most $\alpha/m$, so the total probability of failure is at most $2\alpha/m
= 1/3$.
\end{proof}}

\section{Graph Theory \& Contextual Results}
\label{section:graph theory}

The hereditary graph families form a lattice, since for any two hereditary families $\ensuremath{\mathcal{F}}$ and $\ensuremath{\mathcal{H}}$,
it holds that $\ensuremath{\mathcal{F}} \cap \ensuremath{\mathcal{H}}$ and $\ensuremath{\mathcal{F}} \cup \ensuremath{\mathcal{H}}$ are also hereditary families.  In this section we
review the structure of this lattice, and give some basic results that place the set of constant-PUG
families within this lattice.  For an illustrated summary of this section, see \cref{fig:graph
theory}.

\subsection{The Speed of Hereditary Graph Families}

The speed $|\ensuremath{\mathcal{F}}_n|$ of a hereditary graph family cannot be arbitrary. Classic results of Alekseev
\cite{Ale92,Ale97}, Bollob{\'a}s \& Thomason~\cite{BT95}, and Scheinerman \& Zito~\cite{SZ94} have
classified some of the possible speeds of hereditary graph families. Scheinerman \& Zito~\cite{SZ94}
and Alekseev~\cite{Ale97} showed that the four smallest \emph{layers} of hereditary graph families
are the following:

\begin{enumerate}
	\item The \emph{constant} layer contains families $\ensuremath{\mathcal{F}}$ with $\log |\ensuremath{\mathcal{F}}_n| = \Theta(1)$, and hence $|\ensuremath{\mathcal{F}}_n| = \Theta(1)$,
	\item The \emph{polynomial} layer contains families $\ensuremath{\mathcal{F}}$ with $\log |\ensuremath{\mathcal{F}}_n| = \Theta(\log n)$,
	\item The \emph{exponential} layer contains families $\ensuremath{\mathcal{F}}$ with $\log |\ensuremath{\mathcal{F}}_n| = \Theta(n)$,
	\item The \emph{factorial} layer contains families $\ensuremath{\mathcal{F}}$ with $\log |\ensuremath{\mathcal{F}}_n| = \Theta(n\log n)$.
\end{enumerate}
The graph families with \emph{subfactorial} speed (the first three layers) have simple structure
\cite{SZ94,Ale97}. As demonstrated by earlier examples, the factorial layer is substantially richer and
includes many graph families of theoretical or practical importance. Despite this, no general
characterization is known for them apart from the definition.

\subsection{Constant-Size Deterministic Labeling Schemes}

This paper asks which subset of the hereditary factorial families correspond to the communication
problems with constant-cost randomized protocols. Replacing \emph{randomized} protocols with
\emph{deterministic} protocols, we get a question that is quickly answered by the existing
literature (this corresponds to the gray-colored areas in \cref{fig:prequel}, \cref{fig:conjecture},
and \cref{fig:graph theory}). By the argument in \cref{prop:correspondence 1}, these protocols
correspond to constant-size (deterministic) adjacency labeling schemes, so our question is
answered by a result of Scheinerman \cite{Sch99}: a hereditary family $\ensuremath{\mathcal{F}}$ admits a constant-size
adjacency labeling scheme if and only if it belongs to the \emph{constant, polynomial}, or
\emph{exponential} layer.  Such families have a bounded number of equivalence classes of vertices,
where two vertices $x,y$ are equivalent if their neighborhoods satisfy $N(x) \setminus \{y\} = N(y)
\setminus \{x\}$.

The following proposition follows from the arguments in \cref{section:correspondence}.

\begin{proposition}
A communication problem $f$ admits a constant-cost deterministic protocol if and only if
$\mathfrak{F}(f)$ is in the constant, polynomial, or exponential layer. A hereditary graph family
$\ensuremath{\mathcal{F}}$ is in the constant, polynomial, or exponential layer if and only if there is a constant-cost
deterministic protocol for $\textsc{Adj}_\ensuremath{\mathcal{F}}$.
\end{proposition}

On the other hand, adjacency labels for a factorial family must have size $\Omega(\log n)$ since
graphs in the minimal factorial families can have $\Omega(n)$ equivalence classes of vertices, and
each equivalence class requires a unique label. So there is a jump in label size from $O(1)$ in the
subfactorial layers to $\Omega(\log n)$ in the factorial layers. The original version of this paper
conjectured that a similar gap between $O(1)$ and $\Omega(\log n)$ occurs for adjacency sketching
too; but this is not true, see \cite{HHH21counter}.

\subsection{Minimal Factorial Families}

The factorial layer has a set of 9 \emph{minimal} families, which satisfy the following:
\begin{enumerate}
\item Every factorial family $\ensuremath{\mathcal{F}}$ contains at least one minimal family;
\item For each minimal family $\ensuremath{\mathcal{M}}$, any  hereditary subfamily $\ensuremath{\mathcal{M}}' \subset \ensuremath{\mathcal{M}}$ has subfactorial
speed.
\end{enumerate}
These families were identified by Alekseev \cite{Ale97}, and similar results were independently
obtained by Balogh, Bollob{\'a}s, \& Weinreich~\cite{BBW00}.

 Each minimal factorial family is either a family of
bipartite graphs, or a family of \emph{co-bipartite} graphs (\ie complements of bipartite graphs),
or a family of \emph{split} graphs (\ie graphs whose vertex set can be partitioned into a clique and an independent set).
Six of the minimal families are the following:
\begin{itemize}
\item $\ensuremath{\mathcal{M}}^{{\circ\circ}}$ is the family of bipartite graphs of degree at most 1.
\item $\ensuremath{\mathcal{M}}^{\bullet\circ}$ is the family of graphs whose vertex set can be partitioned into a clique and an independent set
such that ever vertex in each of the parts is adjacent to at most one vertex in the other part.
\item $\ensuremath{\mathcal{M}}^{\bullet\bullet}$ is the family of graphs whose vertex set can be partitioned into two cliques
such that every vertex in each of the parts is adjacent to at most one vertex in the other part.
\item $\ensuremath{\mathcal{L}}^{{\circ\circ}}$, $\ensuremath{\mathcal{L}}^{\bullet\circ}, \ensuremath{\mathcal{L}}^{\bullet\bullet}$ are defined similarly to the families
$\ensuremath{\mathcal{M}}^{{\circ\circ}}$, $\ensuremath{\mathcal{M}}^{\bullet\circ}$, $\ensuremath{\mathcal{M}}^{\bullet\bullet}$, respectively, with the difference that vertices in
each of the parts are adjacent to all but at most one vertex in the other part.
\end{itemize}
The other three minimal families motivate our focus on the \emph{stable} factorial families. They
are defined as follows (see \cref{fig:half graphs}).
\begin{definition}[Chain-Like Graphs]
\label{def:chain-like graphs}
For any $k \in \ensuremath{\mathbb{N}}$, the \emph{half-graph} is the bipartite graph $H^{\circ\circ}_k$ with vertex
sets $\{a_1, \dotsc, a_k\}$ and $\{b_1, \dotsc, b_k\}$, where the edges are exactly the pairs
$(a_i,b_j)$ that satisfy $i \leq j$. The \emph{threshold graph} $H^{\bullet\circ}_k$ is the graph
defined the same way, except including all edges $(a_i,a_j)$ where $i \neq j$.  The
\emph{co-half-graph} $H^{\bullet\bullet}_k$ is the graph defined the same way as the threshold graph
but also including all edges $(b_i,b_j)$ for $i \neq j$.  We define the following hereditary
families, which we collectively refer to as \emph{\chainyGraphs} ($\ensuremath{\mathcal{C}}^{{\circ\circ}}$ is sometimes called
the family of \emph{chain graphs}):
\begin{align*}
  \ensuremath{\mathcal{C}}^{\circ\circ} &\vcentcolon= \mathsf{cl}\{ H_k^{\circ\circ} : k \in \ensuremath{\mathbb{N}} \} \,,
  &\ensuremath{\mathcal{C}}^{\bullet\circ} &\vcentcolon= \mathsf{cl}\{ H_k^{\bullet\circ} : k \in \ensuremath{\mathbb{N}} \} \,,
  &\ensuremath{\mathcal{C}}^{\bullet\bullet} &\vcentcolon= \mathsf{cl}\{ H_k^{\bullet\bullet} : k \in \ensuremath{\mathbb{N}} \} \,.
\end{align*}
\end{definition}

\begin{proposition}[\cite{Ale97}]
The minimal factorial families are
\[
\ensuremath{\mathcal{M}}^{\circ\circ}, \ensuremath{\mathcal{M}}^{\bullet\circ}, \ensuremath{\mathcal{M}}^{\bullet\bullet},  \ensuremath{\mathcal{L}}^{\circ\circ}, \ensuremath{\mathcal{L}}^{\bullet\circ}, \ensuremath{\mathcal{L}}^{\bullet\bullet},
\ensuremath{\mathcal{C}}^{\circ\circ}, \ensuremath{\mathcal{C}}^{\bullet\circ}, \ensuremath{\mathcal{C}}^{\bullet\bullet} \,.
\]
\end{proposition}

It is clear from the definitions that the families $\ensuremath{\mathcal{C}}^{{\circ\circ}}, \ensuremath{\mathcal{C}}^{\bullet\circ}, \ensuremath{\mathcal{C}}^{\bullet\bullet}$ are not
stable, while the other minimal families are. The following statement is easily proved from
\cref{prop:lower bound}.

\begin{fact}
$\ensuremath{\mathcal{M}}^{\circ\circ}, \ensuremath{\mathcal{M}}^{\bullet\circ}, \ensuremath{\mathcal{M}}^{\bullet\bullet},  \ensuremath{\mathcal{L}}^{\circ\circ}, \ensuremath{\mathcal{L}}^{\bullet\circ}, \ensuremath{\mathcal{L}}^{\bullet\bullet}$
admit constant-size equality-based labeling schemes (and therefore
constant-size PUGs), while $\ensuremath{\mathcal{C}}^{{\circ\circ}}, \ensuremath{\mathcal{C}}^{{\bullet\circ}}, \ensuremath{\mathcal{C}}^{{\bullet\bullet}}$ have PUGs of size
$n^{\Theta(1)}$.
\end{fact}

A consequence of Ramsey's theorem is that a hereditary
graph family $\ensuremath{\mathcal{F}}$ is stable if and only if it does not include any of $\ensuremath{\mathcal{C}}^{\circ\circ}, \ensuremath{\mathcal{C}}^{\bullet\circ},
\ensuremath{\mathcal{C}}^{\bullet\bullet}$:
\begin{proposition}
	\label{prop:ch-finite-iff-no-chainlike}
	Let $\ensuremath{\mathcal{F}}$ be a hereditary family of graphs.  Then $\ensuremath{\mathcal{F}}$ has bounded chain number\xspace if and only if
	$\ensuremath{\mathcal{C}}^{\circ\circ},\ensuremath{\mathcal{C}}^{\bullet\circ},\ensuremath{\mathcal{C}}^{\bullet\bullet} \not\subseteq \ensuremath{\mathcal{F}}$.
\end{proposition}
\begin{proof}
	Let $** \in \{\bullet\bullet,\bullet\circ,\circ\circ\}$ and suppose $\ensuremath{\mathcal{C}}^{**} \subseteq \ensuremath{\mathcal{F}}$. By
	definition, $\ensuremath{\mathcal{C}}^{**}$ contains $H_k^{**}$ for any $k \in \ensuremath{\mathbb{N}}$, so $\ch(\ensuremath{\mathcal{C}}^{**}) = \infty$ and if
	$\ensuremath{\mathcal{C}}^{**} \subseteq \ensuremath{\mathcal{F}}$ then $\ch(\ensuremath{\mathcal{F}}) \ge \ch(\ensuremath{\mathcal{C}}^{**}) = \infty$.

	Now suppose $\ensuremath{\mathcal{C}}^{**} \not\subseteq \ensuremath{\mathcal{F}}$ for every $** \in \{\bullet\bullet,\bullet\circ,\circ\circ\}$.
	Then for every $** \in \{\bullet\bullet,\bullet\circ,\circ\circ\}$ there  is some $m^{**}$ such that all graphs $G \in \ensuremath{\mathcal{F}}$ are $H^{**}_{m^{**}}$-free.
	Hence, for $m = \max(m^{\bullet\bullet}, m^{\bullet\circ}, m^{\circ\circ})$,
	all graphs $G \in \ensuremath{\mathcal{F}}$ are $\{H^{\bullet\bullet}_m, H^{\bullet\circ}_m, H^{\circ\circ}_m\}$-free.

	It was proved in~\cite{CS18} that, due to Ramsey's theorem, for every $m \in \ensuremath{\mathbb{N}}$ there exists
	a sufficiently large $k = k(m)$ such that any $\{H^{\bullet\bullet}_m, H^{\bullet\circ}_m,
	H^{\circ\circ}_m\}$-free graph $G$ has $\ch(G) < k$. Hence $\ch(\ensuremath{\mathcal{F}}) < k$.
\end{proof}

Unlike standard universal graphs, PUGs exhibit a large quantitative gap between the \chainyGraphs
and the other minimal factorial families, suggesting that stable factorial families behave much differently than other factorial families and may be worth studying separately, which has not yet been done in the context of understanding the factorial layer of graph families.

\subsection{The Bell Numbers Threshold}

There is another interesting speed threshold within the factorial layer: the Bell numbers threshold.
The Bell number $B_n$ is the number of different set partitions of $[n]$, or equivalently the number
of $n$-vertex equivalence graphs; asymptotically it is $B_n \sim (n / \log n)^n$. Similarly to the
factorial layer itself, there is a set of \emph{minimal} families above the Bell numbers.  However,
unlike the factorial layer, the set of minimal families above the Bell numbers is \emph{infinite},
and it has been characterized explicitly~\cite{BBW05,ACFL16}. Once again, the families $\ensuremath{\mathcal{C}}^{\circ\circ},
\ensuremath{\mathcal{C}}^{\bullet\circ}, \ensuremath{\mathcal{C}}^{\bullet\bullet}$ are minimal. This means that \emph{all} hereditary families below the Bell
numbers are stable. Structural properties of these families were given in \cite{BBW00}, which we use
to prove the following (proof in \cref{section:graph theory proofs}).

\begin{restatable}{theorem}{bellnumbers}
\label{thm:bell numbers}
Let $\ensuremath{\mathcal{F}}$ be a hereditary graph family. Then:
\begin{enumerate}
\item If $\ensuremath{\mathcal{F}}$ is a minimal family above the Bell numbers, then $\ensuremath{\mathcal{F}}$ admits a constant-size
equality-based labeling scheme (and therefore a constant-size PUG), unless
$\ensuremath{\mathcal{F}} \in \{\ensuremath{\mathcal{C}}^{\circ\circ}, \ensuremath{\mathcal{C}}^{\bullet\circ}, \ensuremath{\mathcal{C}}^{\bullet\bullet}\}$.
\item If $\ensuremath{\mathcal{F}}$ has speed below the Bell numbers, then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based
labeling scheme (and therefore a constant-size PUG).
\end{enumerate}
\end{restatable}

\section{Bipartite Graphs}
\label{section:bipartite graphs}

We can transform any graph into a bipartite graph by reinterpreting its adjacency matrix as the
adjacency matrix of a bipartite graph. Performing this transformation on every graph in a hereditary
family $\ensuremath{\mathcal{F}}$ and taking the hereditary closure, we obtain a family of bipartite graphs that admits a
constant-size PUG if and only if the original family does (\cref{prop:bip properties}). It therefore
suffices to study families of bipartite graphs, and the conditions for admitting a constant-size PUG
ought to be preserved by this transformation.

A natural first step towards answering \cref{question:main} is therefore to focus on bipartite
graphs, and in particular the bipartite graph families obtained by forbidding just one induced
subgraph. We find that stability characterizes the families in this class that admit constant-size
PUGs:

\thmbipartite*

\subsection{Transformation to Bipartite Graphs}
\label{sec:bipartite-equiv}
We begin by defining a natural mapping $\mathsf{bip}(G)$ that transforms a graph $G$ into a bipartite graph.

\newcommand{\triangleleft}{\triangleleft}
\begin{definition}
For any graph $G = (V,E)$ we define the colored bipartite graph $\mathsf{bip}(G) = (V,V^\triangleleft,E^\triangleleft)$, where
$V^\triangleleft$ is a copy of $V$, as follows. For each $v \in V$ let $\triangleleft v \in V^\triangleleft$ denote its copy in
$V^\triangleleft$.  Then for each $x,y \in V$ we have $E(x,y) = E(y,x) = E^\triangleleft(x, \triangleleft y) = E^\triangleleft(y, \triangleleft x)$. For
any set $\ensuremath{\mathcal{F}}$ of graphs, we define
\[
  \mathsf{bip}(\ensuremath{\mathcal{F}}) \vcentcolon= \{ \mathsf{bip}(G) : G \in \ensuremath{\mathcal{F}} \} \,.
\]
\end{definition}

This map has the following properties. Recall that, whichever conditions are characteristic of
hereditary graph families that admit constant-size PUGs, they must be preserved by this map.
In the original version of this paper, we conjectured that the two properties of \emph{stability}
and \emph{factorial speed} were necessary and sufficient; we show in this section that both of these
properties are indeed preserved by the bipartite transformation (\cref{prop:bip properties}).

\begin{proposition}
\label{prop:bip properties}
Let $\ensuremath{\mathcal{F}}$ be any hereditary graph family. Then:
\begin{enumerate}
\item $\ensuremath{\mathcal{F}}$ has at most factorial speed if and only if $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ has at most factorial speed.
\label{item:bip 1}
\item $\ensuremath{\mathcal{F}}$ is stable if and only if $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ is stable.
\label{item:bip 2}
\item $\ensuremath{\mathcal{F}}$ admits a constant-size PUG if and only if $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ admits a constant-size PUG.
\label{item:bip 3}
\item $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based labeling scheme if and only if $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$
admits a constant-size equality-based labeling scheme.
\label{item:bip 4}
\end{enumerate}
\end{proposition}
\begin{proof}
\noindent \textbf{Property \ref{item:bip 1}.}
First note that for each $n$, $\mathsf{bip}$ is an injective map from $\ensuremath{\mathcal{F}}_n$ to the set of colored
bipartite graphs $(X,Y,E)$ with $|X|=|Y|=n$. If $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ has at most factorial speed then
$|\ensuremath{\mathcal{F}}_n| = |\mathsf{bip}(\ensuremath{\mathcal{F}}_n)_{2n}| = 2^{O(n \log n)}$, so $\ensuremath{\mathcal{F}}$ has at most factorial speed. Now assume
$\ensuremath{\mathcal{F}}$ has at most factorial speed and let $G \in \mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))_n$. Then
there is $F =(V,E) \in \ensuremath{\mathcal{F}}$ with $\mathsf{bip}(F) = (V,V^\triangleleft, E^\triangleleft) \in \mathsf{bip}(\ensuremath{\mathcal{F}})$ such that $G \sqsubset
\mathsf{bip}(F)$. Let $Z_1 \subseteq V$ and $Z_2 \subseteq V$ be such that
$G$ is isomorphic to the subgraph of $\mathsf{bip}(F)$ induced by $Z_1 \cup Z_2^\triangleleft$. Then $G \sqsubset \mathsf{bip}(F[Z_1 \cup Z_2])$.
Notice that $F[Z_1 \cup Z_2] \in \ensuremath{\mathcal{F}}_m$, where $m = |Z_1|+|Z_2| \leq n$.
So there is a map from $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))_n$ to $\bigcup_{m \leq n} \ensuremath{\mathcal{F}}_m$ where for any $H
\in \ensuremath{\mathcal{F}}_m$, there are at most $2^{2m}$ induced subgraphs of $\mathsf{bip}(H)$, so there are at most $2^{2m}$
graphs in $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))_n$ that are mapped to $H$. We therefore have
\[
  |\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))_n| \leq \sum_{m \leq n} 2^{2m} \cdot |\ensuremath{\mathcal{F}}_m|
        \leq n 2^{2n} 2^{O(n \log n)} = 2^{O(n \log n)} \,.
\]
\noindent \textbf{Property \ref{item:bip 2}.}
First suppose that $\ch(\ensuremath{\mathcal{F}}) = \infty$. For any $k \in \ensuremath{\mathbb{N}}$, let $G = (V,E) \in \ensuremath{\mathcal{F}}$ have $\ch(G) =
k$, so that there are disjoint sets $\{a_1, \dotsc, a_k\}, \{b_1, \dotsc, b_k\} \subset V$ such that
$a_i,b_j$ are adjacent if and only if $i \leq j$. It then holds that $\{a_1, \dotsc, a_k\} \subset
V$ and $\{\triangleleft b_1, \dotsc, \triangleleft b_k\} \subset V^\triangleleft$ are disjoint subsets of vertices in
$\mathsf{bip}(G) = (V,V^\triangleleft,E^\triangleleft)$ witnessing $\ch(\mathsf{bip}(G)) \geq k$. Then for any $k$ it holds that
$\ch(\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))) \geq k$, so $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ is not stable.

Now suppose that $\ch(\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))) = \infty$. For any $k \in \ensuremath{\mathbb{N}}$ there is $H = (X,Y,E_H) \in
\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ with $\ch(H) \geq 2k$, and there is $G \in \ensuremath{\mathcal{F}}$ such that $H \sqsubset \mathsf{bip}(G)$.
Write $G = (V,E_G)$ so that $X \subset V, Y \subset V^\triangleleft, E_H \subset E_G^\triangleleft$. For $m=2k$, let
$\{a_1, \dotsc, a_m \} \subseteq X \subseteq V$ and $\{\triangleleft b_1, \dotsc, \triangleleft b_m\} \subseteq Y
\subseteq V^\triangleleft$ be sets such that $a_i, \triangleleft b_j$ are adjacent in $H$ if and only if $i \leq j$.
If $\{a_1, \dotsc, a_m\}, \{b_1, \dotsc, b_m\}$ are disjoint in $V$ then we are done. Otherwise, let
$t$ be the smallest number such that $a_t \in \{b_1, \dotsc, b_m\}$. Consider two cases.

First suppose $t \geq m/2=k$. Then $\{a_1, \dotsc, a_k\}, \{b_1, \dotsc, b_k\}$ are disjoint, and we
are done. Next suppose that $t < m/2 = k$, and consider the sets $A = \{a_t, \dotsc, a_m\}, B =
\{b_t, \dotsc, b_m\}$. We will show that $A \cap B =\emptyset$.
By definition, $a_t \in \{b_1, \dotsc, b_m\}$. Since $a_t, \triangleleft a_t$ are not
adjacent in $\mathsf{bip}(G)$ but $a_t$ is adjacent to all elements in $\{ \triangleleft b_t, \dotsc, \triangleleft b_m \}$,
it must be that $\triangleleft a_t = \triangleleft b_p$ for some $p < t$.

Suppose for contradiction that $A \cap B \neq \emptyset$. Hence, there is $q > t$ such that $a_q \in B$,
\ie $a_q = b_r$ for some $r \geq t$.
Then $a_t$ is adjacent to $\triangleleft b_r$ since $t \leq r$, so $a_t$ is adjacent to $a_q$ in
$G$. Since $a_t = b_p$ it must be that $a_q$ is adjacent to $b_p$ in $G$, and therefore $a_q$ is adjacent to
$\triangleleft b_p$ in $\mathsf{bip}(G)$. This holds only if $q \leq p$, but by definition we have $p < t < q$, a
contradiction. Consequently, we have $A \cap B = \emptyset$, and we conclude that $\ch(G) \geq m-t
> m/2=k$.

\noindent \textbf{Property \ref{item:bip 3} and Property \ref{item:bip 4}.}
Any adjacency sketch (or equality-based labeling scheme) for $\ensuremath{\mathcal{F}}$ can be used for $\mathsf{bip}(\ensuremath{\mathcal{F}})$ by
simply appending a single bit to each label that indicate whether the vertex belongs to the left or
right part. Any adjacency sketch (or equality-based labeling scheme) for $\mathsf{bip}(\ensuremath{\mathcal{F}})$ is inherited by
$\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$.

From any adjacency sketch for $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$, we can construct a sketch for $\ensuremath{\mathcal{F}}$: for any graph
$G \in \ensuremath{\mathcal{F}}$ and any vertex $x \in V(G)$, assign the sketch $(\mathsf{sk}(x),\mathsf{sk}(x'))$, where $x'$ is the
copy of $x$ in the bipartite transformation. For any pair $x,y$, the decoder outputs what the
bipartite decoder would output given $\mathsf{sk}(x),\mathsf{sk}(y')$.

From any equality-based labeling scheme for $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$, we can construct one for $\ensuremath{\mathcal{F}}$
similarly. For any graph $G =(V,E) \in \ensuremath{\mathcal{F}}$, write $\mathsf{bip}(G) = (V,V^\triangleleft,E^\triangleleft)$. To any vertex $x
\in V$ we assign the label $( p(x), p(\triangleleft x) \eqLabelSep q(x), q(\triangleleft x) )$ from the labeling scheme for
$\mathsf{bip}(G)$. On labels $( p(x), p(\triangleleft x) \eqLabelSep q(x), q(\triangleleft x))$ and  $( p(y), p(\triangleleft y) \eqLabelSep q(y),
q(\triangleleft y))$, simulate the decoder on $( p(x) \eqLabelSep q(x) )$ and $( p(\triangleleft y) \eqLabelSep q(\triangleleft y) )$.
\end{proof}

\ignore
The following conjecture was proposed in \cite{LMZ11}.
\begin{conjecture}[\cite{LMZ11}]
\label{conj:lmz}
A hereditary family $\ensuremath{\mathcal{F}}$ has factorial speed if and only if the largest of the families of
bipartite graphs in $\ensuremath{\mathcal{F}}$, co-bipartite graphs in $\ensuremath{\mathcal{F}}$, and split graphs in $\ensuremath{\mathcal{F}}$, has factorial
speed.
\end{conjecture}

\subsection{Decomposition Scheme for Bipartite Graphs}

In this section we define a decomposition scheme for bipartite graphs that we will use to establish
constant-size adjacency sketches for the stable subfamilies of factorial monogenic bipartite graph
families.

\begin{definition}[$(\ensuremath{\mathcal{Q}},k)$-decomposition tree]
\label{Qkd decomposition tree}
Let $G=(X,Y,E)$ be a bipartite graph, $k \geq 2$, and let $\ensuremath{\mathcal{Q}}$ be a hereditary family of bipartite
graphs.  A graph $G$ admits a \emph{$(\ensuremath{\mathcal{Q}},k)$-decomposition tree of depth $d$} if there is a tree of
depth $d$ of the following form, with $G$ as the root. Each node of the tree is a bipartite graph
$G' = G[X',Y']$ for some $X' \subseteq X, Y' \subseteq Y$, labelled with either $L, D, \overline D$,
or $P$ as follows

	\begin{enumerate}[label=\textup{(\arabic*)}]
		\item $L$ (\emph{leaf node}): The graph $G'$ belongs to $\ensuremath{\mathcal{Q}}$.

		\item $D$ (\emph{$D$-node}): The graph $G'$ is disconnected.
		There are sets $X_1', \dotsc, X_t' \subseteq X'$ and $Y_1', \dotsc, Y_t' \subseteq Y'$
		such that $G[X_1',Y_1'], \dotsc, G[X_t',Y_t']$ are the connected components of $G'$.
		The children of this decomposition tree node are $G[X_1',Y_1'], \dotsc, G[X_t',Y_t']$.

		\item $\overline D$ (\emph{$\overline{D}$-node}): The graph $\bc{G'}$ is disconnected.
		There are sets $X_1', \dotsc, X_t' \subseteq X'$ and $Y_1', \dotsc, Y_t' \subseteq Y'$
		such that $\bc{G[X_1',Y_1']}, \dotsc,  \bc{G[X_t',Y_t']}$
		are the connected components of $\bc{G'}$.
		The children of this decomposition tree node are $G[X_1',Y_1'], \dotsc, G[X_t',Y_t']$.

		\item $P$ (\emph{$P$-node}):
		The vertex set of $G'$ is partitioned into at most $2k$ \emph{non-empty} sets $X_1', X_2', \ldots, X_p' \subseteq X'$ and $Y_1', Y_2', \ldots, Y_q' \subseteq Y'$,
		where $p \leq k$, $q \leq k$. The children of this decomposition tree node are $G[X_i', Y_j']$, for all $i \in[p]$,  $j \in [q]$.
		We say that the $P$-node $G'$ is \emph{specified} by the partitions $X_1', X_2', \ldots, X_p'$ and
		$Y_1', Y_2', \ldots, Y_q'$.
	\end{enumerate}
\end{definition}

\begin{lemma}
\label{lemma:bipartite decomposition}
Let $k \geq 2$ and $d \geq 1$ be natural constants, and let $\ensuremath{\mathcal{Q}}$ be a family of bipartite graphs that
admits a constant-size equality-based adjacency labeling scheme.
Let $\ensuremath{\mathcal{F}}$ be a family of bipartite graphs such that each $G \in \ensuremath{\mathcal{F}}$ admits a $(\ensuremath{\mathcal{Q}}, k)$-decomposition
tree of depth at most $d$. Then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme.
\end{lemma}
\begin{proof}
Let $G=(X,Y,E) \in \ensuremath{\mathcal{F}}$. We fix a $(\ensuremath{\mathcal{Q}}, k)$-decomposition tree of depth at most $d$ for $G$.
For each node $v$ in the decomposition tree we write $G_v$ for the induced subgraph
of $G$ associated with node $v$.  Each leaf node $v$ has $G_v \in \ensuremath{\mathcal{Q}}$.
For some constants $s$ and $r$, we fix an $(s,r)$-equality-based adjacency labeling scheme for $\ensuremath{\mathcal{Q}}$, and for each leaf node $v$, we denote by $\ell'_v$ the function that assigns labels to the vertices of $G_v$ under this scheme.

For each vertex $x$ we will construct a label $\ell(x)$ that consists of a constant number of tuples (as in \cref{rm:conv-form}),
where each tuple contains one prefix of at most two bits, and at most two equality codes.
First, we add to $\ell(x)$ a tuple  $(\alpha(x) \eqLabelSep \mathnormal- )$, where $\alpha(x)=0$ if $x \in X$, and $\alpha(x)=1$
if $x \in Y$. Then we append to $\ell(x)$ tuples defined inductively.
Starting at the root of the decomposition tree, for each node $v$ of the tree where $G_v$
contains $x$, we add tuples $\ell_v(x)$ defined as follows.
Write $X' \subseteq X, Y' \subseteq Y$ for the vertices of $G_v$.
\begin{itemize}
\item If $v$ is a leaf node, then $G_v \in \ensuremath{\mathcal{Q}}$, and we define $\ell_v(x) = (L \eqLabelSep \mathnormal-), \ell'_v(x)$.

\item If $v$ is a $D$-node then $G_v$ is disconnected, with sets $X'_1, \dotsc, X'_t \subseteq X',
Y'_1, \dotsc, Y'_t \subseteq Y$ such that the children $v_1, \dotsc, v_t$ are the connected
components $G_v[X'_1, Y'_1], \dotsc, G_v[X'_t, Y'_t]$ of $G_v$.
We define $\ell_v(x) = (D \eqLabelSep j), \ell_{v_j}(x)$, where $j \in [t]$ is the unique index such that $x$ belongs to the connected component $G_v[X'_j, Y'_j]$, and $\ell_{v_j}(x)$ is the inductively defined label for the child node $v_j$.

\item If $v$ is a $\overline D$-node then $\bc{G_v}$ is disconnected, with sets $X'_1, \dotsc, X'_t \subseteq X',
Y'_1, \dotsc, Y'_t \subseteq Y$ such that $\bc{G_v[X_1',Y_1']}, \dotsc,  \bc{G_v[X_t',Y_t']}$
are the connected components of $\bc{G_v}$, and the children $v_1, \dotsc, v_t$ of $v$ are the graphs $G_v[X'_1, Y'_1], \dotsc, G_v[X'_t, Y'_t]$.
We define $\ell_v(x) = (\overline D \eqLabelSep j), \ell_{v_j}(x)$, where $j \in [t]$ is the unique index such that $x$ belongs to $G_v[X'_j, Y'_j]$, and $\ell_{v_j}(x)$ is the inductively defined label for the child node $v_j$.

\item If $v$ is a $P$-node then let $X'_1, \dotsc, X'_p \subseteq X', Y'_1, \dotsc,
Y'_q \subseteq Y'$ be the partitions of $X',Y'$ with $p,q\le k$.
For each $(i,j) \in [p]\times[q]$, let $v_{i,j}$ be the child
node of $v$ corresponding to the subgraph $G_v[X'_i,Y'_j]$.
If $x \in X$, then there is a unique $i \in [p]$ such that $x \in X'_i$, and
we define $\ell_v(x) = (P \eqLabelSep i, q), \ell_{v_{i,1}}(x), \dotsc, \ell_{v_{i,q}}(x)$,
where $\ell_{v_{i,j}}(x)$ is the label assigned to $x$ at node $v_{i,j}$.
If $x \in Y$, then we define $\ell_v(x) = (P \eqLabelSep i, p), \ell_{v_{1,i}}(x), \dotsc, \ell_{v_{p,i}}(x)$,
where $i \in [q]$ is the unique index such that $x \in Y'_i$.
\end{itemize}
First, we will estimate the size of the label $\ell(x)$ produced by the above procedure.
For every leaf node $v$, the label $\ell_v(x)$ of $x$ is a tuple consisting of an $s$-bit prefix and $r$ equality codes.
Let $f(i)$ be the maximum number of tuples added to $\ell(x)$ by a node $v$ at level $i$ of the decomposition tree,
where the root node belongs to level $0$.
Then, by construction, $f(i) \leq 1 + k \cdot f(i+1)$ and $f(d-1) = 1$, which implies that the total
number of tuples in $\ell(x)$ does not exceed $f(0) \leq k^d$.
Since every tuple contains a prefix
with at most $s' = \max\{2, s\}$ bits, and at most $r' = \max\{ 2, r \}$ equality codes, we have that
the label $\ell(x)$ contains a prefix with at most $s' k^d$ bits, and at most $r' k^d$ equality codes.

We will now show how to use the labels to define an equality-based adjacency decoder.
Let $x$ and $y$ be two arbitrary vertices of $G$. The decoder first checks the first tuples
$(\alpha(x) \eqLabelSep -)$ and $(\alpha(y) \eqLabelSep -)$ of the labels $\ell(x)$ and $\ell(y)$ respectively, to ensure that
$x,y$ are in different parts of $G$ and outputs 0 if they are not. We may now assume
$x \in X, y \in Y$. The remainder of the labels are of the form $\ell_v(x)$ and $\ell_v(y)$, where
$v$ is the root of the decomposition tree.
\begin{itemize}
\item If the labels $\ell_v(x),\ell_v(y)$ are of the form $(L \eqLabelSep -), \ell'_v(x)$ and $(L \eqLabelSep -), \ell'_v(y)$, then the decoder simulates the decoder for the labeling scheme for $\ensuremath{\mathcal{Q}}$, on inputs
$\ell'_v(x),\ell'_v(y)$, and outputs the correct adjacency value.

\item If the labels $\ell_v(x),\ell_v(y)$ are of the form $(D \eqLabelSep i), \ell_{v_i}(x)$ and
$(D \eqLabelSep j), \ell_{v_j}(y)$, the decoder outputs 0 when $i \neq j$ (\ie $x,y$ are in different connected
components of $G_v$), and otherwise it recurses on $\ell_{v_i}(x), \ell_{v_i}(y)$.

\item If the labels $\ell_v(x),\ell_v(y)$ are of the form $(\overline D \eqLabelSep i), \ell_{v_i}(x)$ and
$(\overline D \eqLabelSep j), \ell_{v_j}(y)$, the decoder outputs 1 when $i \neq j$ (\ie $x,y$ are in different connected
components of $\bc{G_v}$ and therefore they are adjacent in $G_v$), and otherwise it
recurses on $\ell_{v_i}(x), \ell_{v_i}(y)$.

\item If the labels $\ell_v(x)$, $\ell_v(y)$ are of the form $(P \eqLabelSep i, q), \ell_{v_{i,1}}(x), \dotsc, \ell_{v_{i,q}}(x)$
and $\splitaftercomma{(P \eqLabelSep j, p), \ell_{v_{1,j}}(y), \dotsc, \ell_{v_{p,j}}(y)}$ the decoder recurses on
$\ell_{v_{i,j}}(x)$ and $\ell_{v_{i,j}}(y)$.
\end{itemize}
It is routine to verify that the decoder will output the correct adjacency value for $x,y$.
\end{proof}

\begin{remark}[$(\ensuremath{\mathcal{Q}},k)$-tree for general graphs]
A similar decomposition scheme can be used for non-bipartite graph families; we do this for
permutation graphs in \cref{section:permutation graphs}.
\end{remark}

\subsection{Monogenic Bipartite Graph Families}

Let $\ensuremath{\mathcal{H}}$ be a \emph{finite} set of bipartite graphs. It is known \cite{All09} that if the family of
$\ensuremath{\mathcal{H}}$-free bipartite graphs is at most factorial, then $\ensuremath{\mathcal{H}}$ contains a forest and a graph whose bipartite complement is a forest. The converse was conjectured in \cite{LZ17}, where it was verified for monogenic families of bipartite graphs. More specifically,
it was shown that, for a colored bipartite graph $H$, the family of $H$-free bipartite graphs is at most factorial if and only if both $H$ and its bipartite complement is a forest.
It is not hard to show that a colored bipartite graph $H$ is a forest and its bipartite complement is
a forest if and only if $H$ is an induced subgraph of $S_{1,2,3}, P_7$, or one of the graphs $F_{p,q}^*$, $p,q \in \mathbb{N}$ defined below.

\begin{figure}[tbh]
\centering
	\begin{tikzpicture}[xscale=.7,yscale=1.1,semithick]
		\useasboundingbox (-3,-.5) rectangle (18,1.75);
		\begin{scope}
			\foreach \i/\x/\y in {%
					1/0/0,2/0/1,3/1/1,4/1.5/0,5/-1/1,6/-1.5/0,7/-2/1%
				}{
				\node[vertex] (S\i) at (\x,\y) {};
			}
			\foreach \u/\v in {1/2,1/3,1/5,3/4,5/6,6/7} {
				\draw (S\u) to (S\v) ;
			}
			\node at (0,-.5) {$S_{1,2,3}$} ;
		\end{scope}
		\begin{scope}[shift={(6,0)}]
			\foreach \i/\x/\y in {%
					1/-1.5/0,2/-1/1,3/-.5/0,4/0/1,5/.5/0,6/1/1,7/1.5/0
				}{
				\node[vertex] (P\i) at (\x,\y) {};
			}
			\foreach \u/\v in {1/2,2/3,3/4,4/5,5/6,6/7} {
				\draw (P\u) to (P\v) ;
			}
			\node at (0,-.5) {$P_7$} ;
		\end{scope}
		\begin{scope}[shift={(13,0)}]
			\def3}\def\p{5{3}\def\p{5}
			\node[vertex] (c) at (0,1) {} ;
			\begin{scope}[shift={(-.5,0)}]
				\node[vertex] (a) at (0,0) {} ;
				\foreach \i in {1,...,3}\def\p{5}{
					\node[vertex] (a\i) at (-0.5*\i,1) {};
				}
				\foreach \i in {1,...,3}\def\p{5} {
					\draw (a) to (a\i) ;
				}
				\draw (a) to (c);
			\end{scope}
			\begin{scope}[shift={(.5,0)}]
				\node[vertex] (b) at (0,0) {} ;
				\foreach \i in {1,...,\p}{
					\node[vertex] (b\i) at (0.5*\i,1) {};
				}
				\foreach \i in {1,...,\p} {
					\draw (b) to (b\i) ;
				}
				\draw (b) to (c);
			\end{scope}
			\node[vertex] at (4,1) {} ;
			\node at (0,-.5) {$F_{3}\def\p{5,\p}^*$} ;
		\end{scope}
	\end{tikzpicture}
	\caption{The bipartite graphs from \cref{def:S123-P7-Fpq}}
  \label{fig:maximal monogenic bipartite graphs}
\end{figure}

\begin{definition}[$S_{1,2,3}$, $P_7$, $F_{p,q}^*$]
\label{def:S123-P7-Fpq}
See \cref{fig:maximal monogenic bipartite graphs} for an illustration.
\begin{enumerate}[label=\textup{(\arabic*)}]
\item $S_{1,2,3}$ is the (colored) bipartite graph obtained from a star with three leaves by
subdividing one of its edges once and subdividing another edge twice.
\item $P_7$ is the (colored) path on 7 vertices.
\item $F^*_{p,q}$ is the colored bipartite graph with vertex color classes $\{a,b\}$ and
$\{a_{1}, \dotsc, a_{p}\splitaftercomma{, c,} b_{1}, \dotsc, b_{q}, d\}$. The edges are $\{(a, a_{i}) \eqLabelSep i \in[p]\}$, $\{(b,b_{j}) \eqLabelSep j \in [q]\}$, and $(a,c),(b,c)$.
\end{enumerate}
\end{definition}

Combining results due to Allen \cite{All09} (for the $S_{1,2,3}$ and $F^*_{p,q}$ cases) and a result of Lozin \& Zamaraev \cite{LZ17} (for the $P_7$ case), we formally state
\begin{theorem}[\cite{All09,LZ17}]
\label{lem:mongenic-factorial-excludes-P7-S123-Fpq}
Let $H$ be a colored bipartite graph, and let
$\ensuremath{\mathcal{F}}$ be the family of $H$-free bipartite graphs.
If $\ensuremath{\mathcal{F}}$ has at most factorial speed, then $\ensuremath{\mathcal{F}}$ is a subfamily of either the $S_{1,2,3}$-free
bipartite graphs, the $P_7$-free bipartite graphs, or the $F^*_{p,q}$-free bipartite graphs, for some $p,q \in \mathbb{N}$.
\end{theorem}

By the above result, in order to establish \cref{thm:bipartite monogenic}, it suffices to consider
the \emph{maximal} monogenic factorial families of bipartite graphs defined by the forbidden induced
subgraphs $S_{1,2,3}$, $P_7$, $F_{p,q}^*$.

\subsubsection[$S_{1,2,3}$-Free Bipartite Graphs]{\boldmath $S_{1,2,3}$-Free Bipartite Graphs}

In this section, we derive \cref{thm:bipartite monogenic} for the family of $S_{1,2,3}$-free bipartite graphs.
It is known that the family of $S_{1,2,3}$-free bipartite graphs has bounded clique-width \cite{LV08},
and hence it has also bounded twin-width \cite{BKTW20}. Therefore the following theorem
follows immediately from our result for graph families of bounded twin-width (\cref{thm:twin width}).

\begin{theorem}
	\label{th:S123 labeling}
	Let $\ensuremath{\mathcal{F}}$ be a stable family of $S_{1,2,3}$-free bipartite graphs.
	Then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}

\subsubsection[$F^*_{p,q}$-Free Bipartite Graphs]{\boldmath $F^*_{p,q}$-Free Bipartite Graphs}
\label{sec:Fpq}

\begin{figure}[!h]
\centering
	\begin{tikzpicture}[xscale=.7,yscale=1.1,every label/.style={font=\scriptsize,label distance=3pt,text=black!50,anchor=base}]
	\def3}\def\p{5{3}\def\p{5}
		\begin{scope}[shift={(0,0)}]
			\node[vertex,label=$c$] (c) at (0,1) {} ;
			\begin{scope}[shift={(-0.5,0)}]
				\node[vertex,label={[yshift=-5pt]below:$a$}] (a) at (0,0) {} ;
				\foreach \i in {1,...,3}\def\p{5}{
					\node[vertex,label={$a_\i$}] (a\i) at (-0.5*\i,1) {};
				}
				\foreach \i in {1,...,3}\def\p{5} {
					\draw (a) to (a\i) ;
				}
				\draw (a) to (c);
			\end{scope}
			\begin{scope}[shift={(0.5,0)}]
				\node[vertex,label={[yshift=-5pt]below:$b$}] (b) at (0,0) {} ;
				\foreach \i in {1,...,\p}{
					\node[vertex,label={$b_\i$}] (b\i) at (0.5*\i,1) {};
				}
				\foreach \i in {1,...,\p} {
					\draw (b) to (b\i) ;
				}
				\draw (b) to (c);
			\end{scope}
			\node[vertex,label={$d$}] at (3}\def\p{5+.75,1) {} ;
			\node at (0,-1) {$F_{3}\def\p{5,\p}^*$} ;
		\end{scope}
		\begin{scope}[shift={(9,0)}]
			\node[vertex,label=$c$] (c) at (0,1) {} ;
			\begin{scope}[shift={(-0.5,0)}]
				\node[vertex,label={[yshift=-5pt]below:$a$}] (a) at (0,0) {} ;
				\foreach \i in {1,...,3}\def\p{5}{
					\node[vertex,label={$a_\i$}] (a\i) at (-0.5*\i,1) {};
				}
				\foreach \i in {1,...,3}\def\p{5} {
					\draw (a) to (a\i) ;
				}
				\draw (a) to (c);
			\end{scope}
			\begin{scope}[shift={(0.5,0)}]
				\node[vertex,label={[yshift=-5pt]below:$b$}] (b) at (0,0) {} ;
				\foreach \i in {1,...,\p}{
					\node[vertex,label={$b_\i$}] (b\i) at (0.5*\i,1) {};
				}
				\foreach \i in {1,...,\p} {
					\draw (b) to (b\i) ;
				}
				\draw (b) to (c);
			\end{scope}
			\node at (0,-1) {$F_{3}\def\p{5,\p}$} ;
		\end{scope}
		\begin{scope}[shift={(18,0)}]
			\def\p{3}\def\p{5}
			\begin{scope}[shift={(-0.25,0)}]
				\node[vertex,label={[yshift=-5pt]below:$a$}] (a) at (0,0) {} ;
				\foreach \i in {1,...,3}\def\p{5}{
					\node[vertex,label={$a_\i$}] (a\i) at (-0.5*\i,1) {};
				}
				\foreach \i in {1,...,3}\def\p{5} {
					\draw (a) to (a\i) ;
				}
			\end{scope}
			\begin{scope}[shift={(0.25,0)}]
				\node[vertex,label={[yshift=-5pt]below:$b$}] (b) at (0,0) {} ;
				\foreach \i in {1,...,\p}{
					\node[vertex,label={$b_\i$}] (b\i) at (0.5*\i,1) {};
				}
				\foreach \i in {1,...,\p} {
					\draw (b) to (b\i) ;
				}
			\end{scope}
			\node at (0,-1) {$T_{3}\def\p{5}$} ;
		\end{scope}
	\end{tikzpicture}
	\caption{The bipartite graphs considered in \cref{sec:Fpq}.}
\end{figure}

In this section, we prove \cref{thm:bipartite monogenic} for families of $F^*_{p,q}$-free bipartite graphs
by developing a constant-size equality-based adjacency labeling scheme for stable families of $F^*_{p,q}$-free bipartite graphs via a sequence of labeling schemes for special subfamilies each generalizing the previous one.

We denote by $F_{p,q}$ the bipartite graph with parts $\{a,b\}$ and $\{c, a_1, \dotsc, a_p, b_1, \dotsc, b_q\}$, and with edges $(a,c), (b,c), \{(a,a_i) \mid i \in [p] \}, \{(b,b_i) \mid j \in [q]\}$.
We also denote by $T_p$ the bipartite graph on vertex sets $\{a,b\}, \{a_1, \dotsc, a_p, b_1, \dotsc, b_p\}$, where $(a,a_i)$ and $(b,b_i)$ are edges for each $i \in [p]$. So $T_p$ is the disjoint union of two stars with $p+1$ vertices.

\begin{definition}
For $q,s \in \ensuremath{\mathbb{N}}$ we denote by $Z_{q,s}$ the bipartite graph $(X,Y,E)$ with
$|X|=q, |Y|=qs$, where $X = \{x_1, \ldots, x_q \}$, $Y$ is partitioned into $q$
sets $Y = Y_1 \cup \ldots \cup Y_q$ each of size $s$, and for every $i \in [q]$:
\begin{enumerate}[label=\textup{(\arabic*)}]
\item $x_i$ is adjacent to all vertices in $Y_j$ for all $1 \leq j \leq i$, and
\item $x_i$ is adjacent to no vertices in $Y_j$ for all $i < j \leq q$.
\end{enumerate}
\end{definition}
\noindent
Note that $Z_{q,s}$ is obtained from $H^{\circ\circ}_q$ by duplicating every vertex in one of the parts $s-1$ times. In particular, $H^{\circ\circ}_q$ is and induced subgraph of $Z_{q,s}$

\medskip
\noindent
We start with structural results and an equality-based labeling scheme for \emph{one-sided} $T_p$-free bipartite graphs.
A colored bipartite graph $G = (X,Y,E)$ is one-sided $T_p$-free if it does not contain $T_p$
as an induced subgraph such that the centers of both stars belong to $X$. Note that
any $T_p$-free bipartite graph is also a one-sided $T_p$-free graph.

\begin{proposition}
\label{prop:degree order}
Let $G = (X,Y,E)$ be any one-sided $T_p$-free bipartite graph and let $u,v \in X$ satisfy $\deg(u) \leq
\deg(v)$. Then $|N(u) \cap N(v)| > |N(u)|-p$.
\end{proposition}
\begin{proof}
For contradiction, assume $|N(u) \cap N(v)| \leq |N(u)|-p$ so that $|N(u) \setminus N(v)| \geq p$.
Then since $\deg(v) \geq \deg(u)$ it follows that $|N(v) \setminus N(u)| \geq p$. But then $T_p$ is
induced by $\{u,v\}$ and $(N(u)\setminus N(v)) \cup (N(v) \setminus N(u))$.
\end{proof}

\begin{proposition}
\label{prop:intersections}
Suppose $S_1, \dotsc, S_t \subseteq [n]$ each have $|S_i| \geq n-p$ where $n > pt$. Then
$\left|\bigcap_{j =1}^t S_j\right| \geq n-pt$.
\end{proposition}
\begin{proof}
Let $R$ be the set of all $i \in [n]$ such that for some $S_j, i \notin S_j$. Then
\[
  |R| \leq \sum_{j=1}^t (n - |S_j|) \leq \sum_{j=1}^t p = pt \,,
\]
so $\left|\bigcap_{j=1}^t S_j\right| \geq n-|R| \geq n-pt$.
\end{proof}

\begin{lemma}
\label{lemma:tp free structure}
Fix any constants $k,q,p$ such that $k \geq qp+1$ and let $G = (X,Y,E)$ be any one-sided $T_p$-free bipartite graph.
Then there exists $m \geq 0$ and partitions $X =A_0 \cup  A_1 \cup \ldots \cup A_m$ and
$Y = B_1 \cup \ldots \cup B_m \cup B_{m+1}$, where $A_i \neq \emptyset$, $B_i \neq \emptyset$
for every $i \in [m]$, such that the following hold
\begin{enumerate}[label=\textup{(\arabic*)}]
	\item $|B_i| \geq k$, for all $i \in [m]$.
	\item For every $j \in \{0,1, \ldots, m\}$, every $x \in A_j$ has less than $k$ neighbours in $\bigcup_{i \geq j+1} B_i$.
	\item For every $i,j, 1 \leq i \leq j \leq m$, every $x \in A_j$ has more than $|B_i| - p$ neighbours in $B_i$.
	\item If $m \geq q$, then $Z_{q,k-qp}$ is an induced subgraph of $G$.
\end{enumerate}
\end{lemma}
\begin{proof}
	Let $A_0$ be the set of vertices in $X$ that have less than $k$ neighbours. If $A_0 = X$, then
	$m=0$, $A_0$, and $B_1 = Y$ satisfy the conditions of the lemma.
	Otherwise, we construct the remaining parts of partitions using the following procedure.
	Initialize $X' = X \setminus A_0, Y'=Y$, and $i=1$.
	\begin{enumerate}
		\item Let $a_i$ be a vertex in $X'$ with the least number of neighbours in $Y'$.
		\item Let $B_i$ be the set of all neighbors of $a_i$ in $G[X',Y']$.
		\item Let $A_i$ be the set of vertices in $X'$ with degree less than $k$ in $G[X',Y'\setminus B_i]$.
		Note that $A_i$ contains $a_i$.
		\item $X' \gets X' \setminus A_i$, $Y' \gets Y' \setminus B_i$.
		\item If $X' = \emptyset$, then $B_{i+1} = Y'$, let $m=i$, and terminate the procedure;
		Otherwise increment $i$ and return to step 1.
	\end{enumerate}

	\noindent
	Conditions (1) and (2) follow by definition. Next we will prove condition (3) by showing
	that for every $1 \leq i \leq j \leq m$, every $x \in A_j$ has more than $|B_i| - p$ neighbours in $B_i$.
	%
	Suppose, towards a contradiction, that $|N(x) \cap B_i| \leq |B_i|-p$. Consider $X',Y'$ as in round $i$ of
	the construction procedure, so $B_i$ is the neighbourhood of $a_i$ in $G[X',Y']$.
	Then $x$ has degree at least that of $a_i$ in $G[X',Y']$, and hence the conclusion holds by
	Proposition \ref{prop:degree order}.

	Finally, to prove condition (4) we will show that for any $q \leq m$ there exist sets $B'_1 \subseteq B_1, \dotsc, B'_q \subseteq B_q$ so that the vertices $\{a_1, \dotsc, a_q\}$ and the sets $B'_1, \dotsc, B'_q$ induce $Z_{q,k-pq}$.
	%
	First, observe that by construction for every $1 \leq i < j \leq m$, $a_i$ has no neighbours in $B_j$.
	Now, let $i \in [m]$, then by condition (3), for all $i \leq j \leq m$ it holds that $|N(a_j) \cap B_i| > |B_i|-p$.
	Since $|B_i| \geq k > pq$, it holds by Proposition \ref{prop:intersections} that
	\[
		\left|B_i \cap \bigcap_{j=i}^q N(a_j)\right| \geq |B_i| - pq \geq k-pq \,.
	\]
	We define $B'_i = B_i \cap \bigcap_{j=i}^q N(a_j)$.
	Then for each $i \in[m]$ it holds that $a_i$ is adjacent to all vertices in $B'_j$ for all $1 \leq j \leq i$, but $a_i$ is adjacent to no vertices in $B'_j$ for $i < j \leq m$. Hence the vertices $\{a_1, \dotsc, a_q\}$ and the sets $B'_1, \dotsc, B'_q$ induce $Z_{q,k-pq}$, which proves condition (4) and
	concludes the proof of the lemma.
\end{proof}

\begin{lemma}
\label{lemma:tp free labeling}
Let $p \in \mathbb{N}$ and let $\ensuremath{\mathcal{T}}$ be a stable family of one-sided $T_{p}$-free bipartite graphs.
Then $\ensuremath{\mathcal{T}}$ admits a constant-size equality-based adjacency labeling scheme, and hence
$\mathsf{SK}(\ensuremath{\mathcal{T}}_n) = O(1)$.
\end{lemma}
\begin{proof}
	Since $\ensuremath{\mathcal{T}}$ is stable, it does not contain $\ensuremath{\mathcal{C}}^{\circ\circ}$ as a subfamily.
	Let $q$ be the minimum number such that $H^{\circ\circ}_q \not\in \ensuremath{\mathcal{T}}$,
	and let $G=(X,Y,E)$ be an arbitrary graph from $\ensuremath{\mathcal{T}}$.

	Let $k = qp+1$ and let $X =A_0 \cup  A_1 \cup \ldots \cup A_m$ and $Y = B_1 \cup \ldots \cup B_m \cup B_{m+1}$ be partitions satisfying the conditions of \cref{lemma:tp free structure}.
	Since $G$ does not contain $H^{\circ\circ}_q$ as an induced subgraph, it holds that $m < q$.

	We construct the labels for the vertices of $G$ as follows.
	For a vertex $x \in X$ we define $\ell(x)$ as a label consisting of several tuples. The first tuple is
	$(0, i \eqLabelSep -)$, where $i \in \{ 0, 1, \ldots, m \}$ is the unique index such that $x \in A_i$.
	This tuple follows by $i$ tuples $(- \eqLabelSep y^j_1, y^j_2, \ldots, y^j_{p_j}), j \in [i]$, where
	$p_j < p$ and $\{y^j_1, y^j_2, \ldots, y^j_{p_j}\}$ are the non-neighbours of $x$ in $B_j$.
	The last tuple of $\ell(x)$ is $(- \eqLabelSep y^{i+1}_1, y^{i+1}_2, \ldots, y^{i+1}_{k'})$, where $k' < k$
	and $y^{i+1}_1, y^{i+1}_2, \ldots, y^{i+1}_{k'}$ are the neighbours of $x$ in $\bigcup_{i \geq j+1} B_i$.
	%
	For a vertex $y \in Y$ we define $\ell(y) = ( 1, i \eqLabelSep y)$, where $i \in [m+1]$ is the unique index such that $y \in B_i$.

	Note that, in every label, the total length of prefixes is at most $1 + \ceil{\log m} \leq 1 + \ceil{\log q}$, and
	the total number of equality codes depends only on $p,q$, and $k$, which are constants.
	Therefore it remains to show that the labels can be used to define an equality-based adjacency decoder.

	Given two vertices $x,y$ in $G$ the decoder operates as follows.
	First, it checks the first prefixes in the first tuples of $\ell(x)$ and $\ell(y)$.
	If they are the same, then $x,y$ belong to the same part in $G$ and the decoder outputs 0.
	Hence, we can assume that they are different. Without loss of generality, let
	$\ell(x) = (0, i \eqLabelSep -)$ and $\ell(y) = ( 1, j \eqLabelSep y)$, so $x \in A_i \subseteq X$ and $y \in B_j \subseteq Y$.

	If $j \leq i$, then the decoder compares $y$ with the equality codes $y^j_1, y^j_2, \ldots, y^j_{p_j}$ of the $(j+1)$-th tuple of $\ell(x)$. If $y$ is equal to at least one of them, then $y$ is among the non-neighbours of $x$ in $B_j$ and the decoder outputs 0; otherwise, $x$ and $y$ are adjacent and the decoder outputs 1.
	If $j > i$, then the decoder compares $y$ with the equality codes $y^{i+1}_1, y^{i+1}_2, \ldots, y^{i+1}_{k'}$ of the last tuples of $\ell(x)$, and
	if $y$ is equal to at least one of them, then $y$ is among the neighbours of $x$ in
	$\bigcup_{i \geq j+1} B_i$ and the decoder outputs 1; otherwise, $x$ and $y$ are not adjacent and
	the decoder outputs 0.
\end{proof}

\medskip
\noindent
Next, we develop an equality-based labeling scheme for stable families of one-sided $F_{p,p}$-free bipartite graphs.
A colored bipartite graph $G = (X,Y,E)$ is one-sided $F_{p,p}$-free if it does not contain $F_{p,p}$
as an induced subgraph such that the part of $F_{p,p}$ of size 2 is a subset of $X$.

\begin{proposition}
\label{prop:degree intersection bound}
Let $G = (X,Y,E)$ be any one-sided $F_{p,p}$-free bipartite graph and let $u,v \in X$ satisfy $\deg(u) \leq \deg(v)$. Then either $N(u) \cap N(v) = \emptyset$ or $|N(u) \cap N(v)| > |N(u)|-p$.
\end{proposition}
\begin{proof}
Suppose that $N(u) \cap N(v) \neq \emptyset$, and for contradiction assume that $|N(u) \setminus
N(v)| \geq p$. Since $\deg(u) \leq \deg(u)$, this means $|N(v) \setminus N(u)| \geq |N(u)
\setminus N(v)| \geq p$. Let $w \in N(u) \cap N(v)$. Then $\{u,v\}$ with $\{w\} \cup (N(v) \setminus
N(u)) \cup (N(u) \setminus N(v))$ induces a graph containing $F_{p,p}$, a contradiction.
\end{proof}

\begin{proposition}
\label{prop:transitive intersections}
Let $G = (X,Y,E)$ be any one-sided $F_{p,p}$-free bipartite graph and let $x,y,z \in X$ satisfy $\deg(x) \geq \deg(y) \geq \deg(z) \geq 2p$. Suppose that $N(y) \cap N(z) \neq \emptyset$. Then
\[
  N(x) \cap N(y) = \emptyset \iff N(x) \cap N(z) = \emptyset \,.
\]
\end{proposition}
\begin{proof}
Since $N(y) \cap N(z) \neq \emptyset$, it holds that $|N(y) \cap N(z)| > |N(z)|-p \geq p$ by
Proposition \ref{prop:degree intersection bound}.

Suppose that $N(x) \cap N(y) \neq \emptyset$. For contradiction, assume that $N(x) \cap N(y) \cap
N(z) = \emptyset$. Then $|N(y) \setminus N(x)| \geq |N(y) \cap N(z)| > |N(z)|-p \geq p$, which
contradicts $|N(y) \cap N(x)| > |N(y)|-p$.

Now suppose that $N(x) \cap N(y) = \emptyset$. For contradiction, assume that $N(x) \cap N(z) \neq
\emptyset$. Then $|N(x) \cap N(z)| \leq |N(z) \setminus N(y)| < p \leq |N(z)|-p
< |N(x) \cap N(z)|$, a contradiction.
\end{proof}

We will say that a bipartite graph $G = (X,Y,E)$ is \emph{left-disconnected} if there are two
vertices $x,y \in X$ that are in different connected components of $G$. It is \emph{left-connected} otherwise.

\begin{proposition}
\label{prop:highest degree connected}
Let $G = (X,Y,E)$ be any one-sided $F_{p,p}$-free bipartite graph where every vertex in $X$ has degree at least $2p$. Let $x \in X$ have maximum degree of all vertices in $X$. If $G$ is left-connected, then for any $y \in X$ it holds that $|N(y) \cap N(x)| > |N(y)|-p$.
\end{proposition}
\begin{proof}
Let $y \in X$. Since $G$ is left-connected, there is a path from $y$ to $x$. Let $y_0,y_1,\dotsc,y_t$ be
the path vertices in $X$, where $y=y_0,x=y_t$, and $N(y_{i-1}) \cap N(y_i) \neq \emptyset$ for each
$i \in [t]$. By Propositions \ref{prop:transitive intersections} and \ref{prop:degree intersection
bound}, it holds that if $N(y_i) \cap N(x) \neq \emptyset$ then $|N(y_i) \cap N(x)| > |N(y_i)|-p$
and $|N(y_{i-1}) \cap N(x)| > |N(y_{i-1})|-p$. Therefore the conclusion holds, because $N(y_{t-1})
\cap N(x) = N(y_{t-1}) \cap N(y_t) \neq \emptyset$.
\end{proof}

\begin{lemma}
\label{lemma:Fpq structure}
Fix any constants $p,q \geq 1$, let $k = (q+1)p$, and let $G = (X,Y,E)$ be any
connected one-sided $F_{p,p}$-free bipartite graph.
Then there exists a partition $X = X_0 \cup X_1 \cup X_2$ (where some of the sets can be empty) such that the following hold:
\begin{enumerate}[label=\textup{(\arabic*)}]
	\item $X_0$ is the set of vertices in $X$ that have degree less than $k$.
	\item The induced subgraph $G[X_1,Y]$ is one-sided $T_p$-free.
	\item The induced subgraph $G[X_2,Y]$ is left-disconnected.
	\item For any $r, s$ such that $r < q$ and $p < s \leq k$, if $X_1 \neq \emptyset$ and $Z_{r,s} \sqsubset G[X_2,Y]$, then $Z_{r+1,s-p} \sqsubset G$.
\end{enumerate}
\end{lemma}
\begin{proof}
	Let $X_0$ be the set of vertices in $X$ that have degree less then $k$,
	and let $X' = X \setminus X_0$. If $G[X', Y]$ is left-disconnected, then we define
	$X_1 = \emptyset$ and $X_2 = X'$.

	Assume now that $G[X', Y]$ is left-connected. By Proposition \ref{prop:highest degree connected}, the highest-degree vertex $x \in X'$ satisfies $|N(x) \cap N(y)| > |N(y)|-p$ for every $y \in X'$. Define $X_1$ as follows: add the highest-degree vertex $x$ to $X_1$, and repeat until $G[X' \setminus X_1,Y]$ is left-disconnected. Then set $X_2 = X' \setminus X_1$.  Condition 3 holds by definition, so it remains to prove conditions 2 and 4.

	For every $a,b \in X_1$, note that $N(a) \cap N(b) \neq \emptyset$. Suppose for contradiction that
	$T_p \sqsubset G[X_1,Y]$, then there are $a,b \in X_1$ such that $T_p$ is contained in the subgraph induced by the vertices $\{a,b\}$ and $(N(a) \setminus N(b)) \cup (N(b) \setminus N(a))$.  But then adding any $c \in N(a) \cap N(b)$ results in a forbidden copy of induced $F_{p,p}$, a contradiction. This proves condition 2.

Now for any $r, s$ such that $r < q$ and $p < s \leq k$, suppose that $X_1 \neq \emptyset$ and $Z_{r,s} \sqsubset G[X_2,Y]$. Then there are $u_1, \dotsc, u_r \in X_2$ and pairwise disjoint sets $V_1 \subseteq N(u_1), \dotsc, V_r \subseteq N(u_r)$ such that for
each $i$, $|V_i| = s$, for every $1 \leq j \leq i$, $v_i$ is adjacent to all vertices in $V_j$, and
for every $i < j \leq r$, $v_i$ is adjacent to no vertices in $V_j$.

Let $x$ be the vertex in $X_1$ with least degree, so that $x$ was the last vertex to be added to
$X_1$. Then $G[X_2 \cup \{x\},Y]$ is left-connected but $G[X_2,Y]$ is left-disconnected, and $x$ is
the highest-degree vertex of $G[X_2 \cup \{x\},Y]$ in $X_2 \cup \{x\}$. Since $u_1, \dotsc, u_r$ are
in the same connected component of $G[X_2,Y]$, but the graph $G[X_2,Y]$ is disconnected, it must be that there is $z \in X_2$ such that $N(z) \cap N(u_i) = \emptyset$ for all $u_i$.
It is also the case that $|N(x) \cap N(z)| > |N(z)|-p \geq k-p \geq s-p$ by Proposition \ref{prop:highest degree connected}, since $x$ has the highest degree in $X_2 \cup \{x\}$.

Observe that for each $V_i \subseteq N(u_i)$ it holds that $|N(x) \cap V_i| \geq s - p$ also by
Proposition \ref{prop:highest degree connected}. Set $V'_i = V_i \cap N(x)$ for each $i \in [r]$,
and set $V'_{r+1} = N(x) \cap N(z)$.
Clearly, the graph induced by
$\{u_1, \dotsc, u_r, x\} \cup V'_1 \cup V'_2 \cup \ldots \cup V'_r \cup V'_{r+1}$ contains
$Z_{r+1,s-p}$ as an induced subgraph.
\end{proof}

We will now use the above structural result to construct a suitable decomposition
scheme for stable one-sided $F_{p,p}$-free bipartite graphs.
Let $p,q \geq 1$ be fixed constants, let $k = (q+1)p$, and let $\ensuremath{\mathcal{F}}_{p,q}$
be the family of one-sided $F_{p,p}$-free bipartite graphs that do not contain $H^{\circ\circ}_q$
as an induced subgraph.
Let $G=(X,Y,E) \in \ensuremath{\mathcal{F}}_{p,q}$.
Using \cref{lemma:Fpq structure}, we define a decomposition tree $\ensuremath{\mathcal{T}}$ for $G$ inductively as follows.
Let $G_v$ be the induced subgraph of $G$ associated with node $v$ of the decomposition tree and write $X' \subseteq X$, $Y' \subseteq Y$ for its sets of vertices, so $G_v = G[X',Y']$.
Graph $G$ is associated with the root node of $\ensuremath{\mathcal{T}}$.
\begin{itemize}
	\item If $G_v$ is one-sided $T_k$-free, terminate the decomposition, so $v$ is a leaf node ($L$-node) of the decomposition tree.
	\item If $G_v$ is disconnected (in particular, if it is left-disconnected), then $v$ is a $D$-node such
	that the children are the connected components of $G_v$.
	\item If $G_v$ is connected and not one-sided $T_k$-free, then $X'$ admits a partition
	$X' = X_0' \cup X_1' \cup X_2'$ satisfying the condition of \cref{lemma:Fpq structure}.
	Since $G_v$ is connected, $X_0' \cup X_1' \neq \emptyset$. Furthermore, since
	$G_v$ is not one-sided $T_k$-free, $X_2' \neq \emptyset$. Hence, $v$ is a $P$-node
	with exactly two children $v_1$ and $v_2$, where $G_{v_1} = G[X_0' \cup X_1', Y']$ and
	$G_{v_2} = G[X_2', Y']$. Observe that
	\begin{enumerate}
		\item[(1)] $G_{v_1}$ is one-sided $T_k$-free, and therefore $v_1$ is a leaf;
		\item[(2)] $G_{v_2}$ is left-disconnected, and therefore $v_2$ is a $D$-node; furthermore, every vertex $x \in X_2'$ has degree at least $k$ in $G_{v_2}$ (otherwise it would be included in the set $X_0'$).
	\end{enumerate}
\end{itemize}

\begin{proposition}\label{prop:Fpp-decomposition}
	Let $\ensuremath{\mathcal{Q}}$ be the family of one-sided $T_k$-free bipartite graphs.
	Then the graphs in $\ensuremath{\mathcal{F}}_{p,q}$ admit $(\ensuremath{\mathcal{Q}},2)$-decomposition trees of depth at most $2q$.
\end{proposition}
\begin{proof}
	By definition, the above decomposition scheme produces $(\ensuremath{\mathcal{Q}},2)$-decomposition trees.
	In the rest of the proof we will establish the claimed bound on the depth of any such tree.
	Suppose, towards a contradiction, that there exists a graph $G=(X,Y,E) \in \ensuremath{\mathcal{F}}_{p,q}$
	such that the decomposition tree $\ensuremath{\mathcal{T}}$ for $G$ has depth at least $2q+1$.
	Let $\ensuremath{\mathcal{P}} = (v_0,v_1, v_2, \ldots, v_s)$ be a leaf-to-root path in $\ensuremath{\mathcal{T}}$ of length $s \geq 2q+1$, where
	$v_0$ is a leaf and $v_s$ is the root. Denote by $G_{v_i} = G[X^{i}, Y^{i}]$ the graph
	corresponding to a node $v_i$ in $\ensuremath{\mathcal{P}}$.
	%
	By construction, all internal nodes of $\ensuremath{\mathcal{P}}$ are either $D$-nodes or $P$-nodes.
	Clearly, the path cannot contain two consecutive $D$-nodes, as any child of a $D$-node
	is a connected graph.
	Furthermore, a unique non-leaf child $v_i$ of a $P$-node is a $D$-node,
	and every $x \in X^{i}$ has degree at least $k$ in $G_{v_i}$.
	Consequently, $P$-nodes and $D$-nodes alternated along (the internal part of) $\ensuremath{\mathcal{P}}$.

	Let $v_{i-1}, v_i, v_{i+1}, v_{i+2}$ be four internal nodes of $\ensuremath{\mathcal{P}}$,
	where $v_{i-1}$ and $v_{i+1}$ are $D$-nodes, and $v_i$ and $v_{i+2}$ are $P$-nodes.
	Recall that, since the parent $v_{i+2}$ of $v_{i+1}$ is a $P$-node, every vertex in $X_{i+1}$ has degree at least $k$ in $G_{v_{i+1}}$.
	Hence, since $G_{v_i}$ is a connected component of $G_{v_{i+1}}$, every vertex in $X^{i} \subseteq X^{i+1}$ also has degree at least $k$.
	Let $X^{i} = X^{i}_0 \cup X^{i}_1 \cup X^{i}_2$ be the partition of $X^{i}$ according to the decomposition rules. Since $X^{i}_0 \cup X^{i}_1 \neq \emptyset$ and $X^i_0 = \emptyset$, we conclude that $X^{i}_1 \neq \emptyset$. Therefore, by \cref{lemma:Fpq structure}, if the $G_{v_{i-1}} = G[X^{i}_2, Y^i]$ contains $Z_{r,s}$ for some $r < q$ and $p < s \leq k$, then $G_{v_i}$ contains $Z_{r+1, s-p}$.

	Let $v_t$ be the first $D$-node in $\ensuremath{\mathcal{P}}$. Note that $t \leq 2$. Every vertex in $X^t$ has degree at least $k$
	in $G_{v_t}$, and therefore $Z_{1,k} \sqsubset G_{v_t}$. By induction, the above discussion implies that
	for $1 \leq i \leq q-1$, the graph $Z_{1+i,k-ip}$ is an induced subgraph of $G_{v_{t+2i-1}}$.
	Hence, since the length of $\ensuremath{\mathcal{P}}$ is at least $2q+1$, we have $H^{\circ\circ}_q = Z_{q,1} \sqsubset Z_{q,k-(q-1)p} \sqsubset G_{v_{t+2q-3}} \sqsubset G$, a contradiction.
\end{proof}

\begin{lemma}
\label{lemma:Fpq labeling scheme}
Let $p \in \mathbb{N}$ and let $\ensuremath{\mathcal{F}}$ be a stable family of one-sided $F_{p,p}$-free bipartite graphs.
Then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{lemma}
\begin{proof}
	Since $\ensuremath{\mathcal{F}}$ is stable, it does not contain $\ensuremath{\mathcal{C}}^{\circ\circ}$ as a subfamily.
	Let $q$ be the minimum number such that $H^{\circ\circ}_q \not\in \ensuremath{\mathcal{F}}$.
	Let $k = (q+1)p$ and let $\ensuremath{\mathcal{Q}}$ be the family of one-sided $T_k$-free bipartite graphs.
	We have that $\ensuremath{\mathcal{F}} \subseteq \ensuremath{\mathcal{F}}_{p,q}$, and therefore, by \cref{prop:Fpp-decomposition}, the graphs in $\ensuremath{\mathcal{F}}$ admit $(\ensuremath{\mathcal{Q}},2)$-decomposition trees of depth at most $2q$.
	Hence, by \cref{lemma:tp free labeling} and \cref{lemma:bipartite decomposition},
	$\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme.
\ignore{
Let $k = (q+1)p$ and let $G = (X,Y,E) \in \ensuremath{\mathcal{F}}_{p,q}$. We will first assume that all vertices in $X$
have degree at least $k$. We will construct a decomposition tree for $G[X, Y]$ inductively as
follows.  Let $G_v$ be the induced subgraph of $G$ associated with node $v$ and write $X' \subseteq X$ for its
set of left vertices, so $G_v = G[X',Y]$.
\begin{itemize}
\item If $G_v$ is $T_p$-free, terminate the decomposition, so $v$ is a leaf node ($L$-node) of the
decomposition tree.
\item If $G_v$ is left-disconnected (and therefore disconnected), let $X_1, \dotsc, X_t \subseteq
X'$ be the left-connected components of $G_v$, and create child nodes $v_1, \dotsc, v_t$, so that
the graph $G_{v_i}$ associated with $v_i$ is the graph $G_{v_i} = G[X_i,Y]$. So $v$ is a $D$-node.
\item Otherwise there is a partition $X' = X_1 \cup X_2$ satisfying the conditions of
\cref{lemma:Fpq structure}. Create child nodes $v_1,v_2$ so that $G_{v_1} = G[X_1,Y], G_{v_2} =
G[X_2,Y]$, where $G_{v_1}$ is left-disconnected and $G_{v_2}$ is $T_p$-free. So $v$ is a $P$-node.
\end{itemize}
The induced subgraphs associated with each node all include the whole set $Y$. Then, since each node
in $X$ has degree at least $k$, each left vertex in every graph $G_v$ has degree at least $k$.
The leaf nodes of the decomposition tree are all associated with a $(T_p,H^{\circ\circ}_q)$-free
induced subgraph of $G$. The remaining nodes are $D$- or $P$-nodes, and every leaf-to-root path
begins with a leaf node and then alternates $P$- and $D$-nodes. We must show that the depth of this
decomposition tree is bounded.

Consider any leaf node $u$, so that $G_u = G[X',Y]$ is $(T_p,H^{\circ\circ}_q)$-free with all
vertices of $X'$ having degree at least $k$. Choosing any vertex in $X'$ and its neighborhood in $Y$
gives us an induced $Z_{1,k}$ subgraph.

Now consider the leaf-to-root path from $u$. For any node $v$ along this path, let $\pi=\pi(v)$ be
the number of leaf- and $P$-nodes on the path from $u$ to $v$. We will prove by induction
on $\pi(v)$ that when $\pi(v) < q+2$, $Z_{\max(1,\pi-1),k-p(\pi-1)} \sqsubset G_v$. The base case
$\pi=1$ (where $v$ is a leaf) is proved above. For $\pi > 1$, if $v$ is a $D$-node the result is
trivial, so we may assume that $v$ is a $P$-node, so the children of $v$ are the graphs
$G_v[X_1,Y],G_v[X_2,Y]$, where $X'=X_1 \cup X_2$ is the partition defined in \cref{lemma:Fpq
structure}. In the special case $\pi=2$, it may be that $G_u = G_v[X_1,Y]$. Then
$Z_{\max(1,\pi-1),k-p(\pi-1)} = Z_{1,k-p} \sqsubset Z_{1,k} \sqsubset G_u \sqsubset G_v$, so the
conclusion holds. Otherwise, we have that the child $w$ of $v$ in the path from $u$ to $v$ satisfies $G_w
\sqsubset G_v[X_2,Y]$. Since $\pi(w)=\pi(v)-1$, it holds by induction that $Z_{\pi-2,k-p(\pi-2)}
\sqsubset G_w=G_v[X_2,Y]$. By \cref{lemma:Fpq structure}, if $\pi-2 < q$ then we can conclude that
$Z_{\pi-1,k-p(\pi-1)} \sqsubset G_v$ as desired.

Suppose for contradiction that some node $v$ has $\pi(v) = q+1$. Then $H^{\circ\circ}_q \sqsubset
Z_{q,k-pq} \sqsubset G_v \sqsubset G$, which is forbidden. Then it must be the case that $\pi(v)
\leq q$ for all nodes on the leaf-to-root path from $u$. We conclude that the depth of the
decomposition tree is at most $2q$, since at least half of the nodes on any leaf-to-root path are
$P$-nodes or leaf nodes.

For graphs with some vertices in $X$ having degree less than $k$, we can let $X' \subseteq X$ be the
set of vertices. Then we can include an addition $P$-node at the root of the decomposition tree,
which has children $G[X',Y]$ and $G[X \setminus X',Y]$, where $G[X',Y]$ is a bipartite graph with
degeneracy at most $k$. The conclusion now follows from \cref{lemma:bipartite decomposition}, where
we use the above $(\ensuremath{\mathcal{Q}},2)$-decomposition tree with $\ensuremath{\mathcal{Q}}$ being the family of bipartite graphs in
$\ensuremath{\mathcal{T}}_{k,q,p}$ and those with degeneracy at most $k$. This has $\mathsf{SK}(\ensuremath{\mathcal{Q}}_n) = O(k)$ by \cref{lemma:tp
free labeling} and \cref{lemma:arboricity}.}
\end{proof}

We conclude this section by showing that stable families of $F^*_{p,p'}$-free graphs admit
constant-size equality-based adjacency labeling schemes. For this we will use the above result for
one-sided $F_{p,p}$-free graphs and the following

\begin{proposition}[\cite{All09}, Corollary 9]
\label{prop:allen F*}
Let $G = (X,Y,E)$ be a $F^*_{p,p}$-free bipartite graph. Then there is a partition $X = X_1 \cup
X_2$ and $Y = Y_1 \cup Y_2$, where $|Y_2| \leq 1$, such that both $G[X_1,Y_1]$ and $\bc{G[X_2,Y_1]}$ are one-sided $F_{p,p}$-free.
\end{proposition}

\begin{theorem}
\label{th:Fpq labeling}
For any constants $p,p' \geq 1$, a stable family $\ensuremath{\mathcal{F}}$ of $F^*_{p,p'}$-free bipartite graphs
admits a constant-size equality-based adjacency labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
	As before, since $\ensuremath{\mathcal{F}}$ is stable, it does not contain $\ensuremath{\mathcal{C}}^{\circ\circ}$ as a subfamily.
	Let $q$ be the minimum number such that $H^{\circ\circ}_q \not\in \ensuremath{\mathcal{F}}$, and
	assume without loss of generality that $p \geq p'$.
	%
	It follows that $\ensuremath{\mathcal{F}}$ is a subfamily of $(F^*_{p,p}, H^{\circ\circ}_q)$-free bipartite
	graphs. Let $G = (X,Y,E)$ be a member of this family. Let $X=X_1\cup X_2, Y = Y_1 \cup Y_2$ be the partition given by \cref{prop:allen F*}. We assign labels as follows.

We start the label for each vertex with a one-bit prefix indicating whether it is in $X$ or $Y$. We
then append the following labels. For $x \in X$, we use another one-bit prefix that is equal to 1 if $x$ is adjacent to the unique vertex $Y_2$, and 0 otherwise. Then, we use one more one-bit prefix to indicate whether $x \in X_1$ or $x \in X_2$. If $x \in X_1$, complete the label by using the labeling scheme of \cref{lemma:Fpq labeling scheme} for $G[X_1,Y_1]$. If $x \in X_2$, complete the label by using the labeling scheme of \cref{lemma:Fpq labeling scheme} for $\bc{G[X_2,Y_1]}$.

For $y \in Y$, use a one-bit prefix to indicate whether $y \in Y_2$. If $y \in Y_1$ then concatenate the two labels for $y$ obtained from the labeling scheme of \cref{lemma:Fpq labeling scheme} for
$G[X_1,Y_1]$ and $\bc{G[X_2,Y_1]}$.

The decoder first checks if $x,y$ are in opposite parts. Now assume $x \in X, y \in Y$. The decoder
checks if $y \in Y_2$ and outputs the appropriate value using the appropriate prefix from the label of
$x$. Then if $x \in X_1$, it uses the labels of $x$ and $y$ in $G[X_1,Y_1]$; otherwise it uses the
labels of $x$ and $y$ in $\bc{G[X_2,Y_1]}$ and flips the output.
\end{proof}

\ignore{
\subsection{Other Bipartite Graph Families}

\begin{theorem}
	Let $H$ be a graph, $p \geq 1$, and let $\ensuremath{\mathcal{F}}$ be the family of $K_{p,p}$-free bipartite graphs that do not contain a subdivision
	of $H$ as an induced subgraph. Then $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
	Follows from the fact that $\ensuremath{\mathcal{F}}$ has bounded degeneracy \cite{KO04}.
\end{proof}

\begin{corollary}
	For every $p \geq 1$ and $q \geq 4$, the family $\ensuremath{\mathcal{F}}$ of $(K_{p,p}, C_q, C_{q+1}, C_{q+2}, \ldots )$-free bipartite graphs
	has $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{corollary}

\begin{theorem}
	For every $p \geq 1$ and any tree $T$, the family $\ensuremath{\mathcal{F}}$ of $(T, K_{p,p})$-free bipartite graphs has $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
	Follows from the fact that $\ensuremath{\mathcal{F}}$ has bounded degeneracy \cite{KP94}\todo{VZ: cannot access the paper to double-check. Can anyone get access to the paper?}.
\end{proof}

\begin{theorem}
	For every $p ,q \geq 1$ and any chain graph $C$, the family $\ensuremath{\mathcal{F}}$ of $(q K_{1,p}, \overline{q K_{1,p}}^b, C)$-free bipartite graphs has $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
	Follows from \cref{th:Fpq labeling} and the fact that there exist constants $k=k(p,q)$ and $c=c(p,q)$
	such that the vertex set of any $(q K_{1,p}, \overline{q K_{1,p}}^b)$-free bipartite graph
	can be partitioned into at most $k$ bags such that the subgraph induced by each pair of bags is $2 K_{1,c}$-free
	bipartite graph \cite{Atm17}.
\end{proof}
}

\subsubsection[$P_7$-Free Bipartite Graphs]{\boldmath $P_7$-Free Bipartite Graphs}
\label{subsection:P7}

In this section, we prove \cref{thm:bipartite monogenic} for $P_7$-free bipartite graphs
by developing a constant-size equality-based adjacency labeling scheme for stable families of $P_7$-free bipartite graphs

In the below definition, for two disjoint sets of vertices $A$ and $B$ we say
that $A$ is \emph{complete} to $B$ if every vertex in $A$ is adjacent to every vertex in $B$; we also say that $A$ is  \emph{anticomplete} to $B$ if there are no edges between $A$ and $B$.

\begin{definition}[Chain Decomposition]
\label{def: chain decomp}
See \cref{fig:chain decomposition} for an illustration of the chain decomposition.
Let $G=(X,Y,E)$ be a bipartite graph and $k \in \ensuremath{\mathbb{N}}$.  We say that $G$ admits a $k$-\textit{chain\xspace
decomposition} if one of the parts, say $X$, can be partitioned into subsets $A_1, \ldots, A_k, C_1,
\ldots, C_k$ and the other part $Y$ can be partitioned into subsets $B_1, \ldots, B_k, D_1, \ldots,
D_k$ in such a way that:
	\begin{itemize}
		\item For every $i \leq k-1$, the sets $A_i, B_i,C_i,D_i$ are non-empty. For $i=k$, at least one of the sets $A_i, B_i,C_i,D_i$ must be non-empty.
		\item For each $i =1, \ldots, k$,
		\begin{itemize}
			\item every vertex of $B_i$ has a neighbour in $A_i$;
			\item every vertex of $D_i$ has a neighbour in $C_i$;
		\end{itemize}
		\item For each $i = 2, \ldots, k-1$,
		\begin{itemize}
			\item every vertex of  $A_i$ has a non-neighbour in $B_{i-1}$;
			\item	every vertex of $C_i$ has a non-neighbour in $D_{i-1}$;
		\end{itemize}
		\item For each $i = 1, \ldots, k$,
		\begin{itemize}
			\item the set $A_i$ is anticomplete to $B_j$ for $j > i$ and
			is complete to $B_j$ for $j < i-1$;
			\item the set $C_i$ is anticomplete to $D_j$ for $j > i$ and
			is complete to $D_j$ for $j < i-1$;
		\end{itemize}
		\item For each $i = 1, \ldots, k$,
		\begin{itemize}
			\item the set $A_i$ is complete to $D_j$ for $j < i$, and is anticomplete to
			$D_j$ for $j \geq i$;
			\item	the set $C_i$ is complete to $B_j$ for $j < i$, and is anticomplete to $B_j$ for $j \geq i$.
		\end{itemize}
	\end{itemize}
\end{definition}

\begin{figure}[ht]
	\begin{center}
		\input{chain_decomp_figure}
	\end{center}
	\caption{Example of a 4-chain decomposition.}
	\label{fig:chain decomposition}
\end{figure}
\begin{remark}
\label{rem:2-chain decomp}
In the case of a $2$-chain decomposition of a connected $P_7$-free bipartite graphs, we will also
need the fact that every vertex in $A_2$ and every vertex in $A_1$ have a neighbour in common; and
every vertex in $C_2$ and every vertex in $C_1$ have a neighbour in common. This is not stated
explicitly in \cite{LZ17}, but easily follows from a proof in \cite{LZ17}.
Since the neighbourhood of every vertex in $A_1$ lies entirely in $B_1$, the above fact implies
that every vertex in $A_2$ has a neighbour in $B_1$. Similarly, the neighbourhood of every vertex in
$C_1$ lies entirely in $D_1$, and therefore every vertex in $C_2$ has a neighbour in $D_1$.
\end{remark}

\begin{theorem}[\cite{LZ17}]\label{thm:P7_chain_dec}
	Let $G=(X,Y,E)$ be a $P_7$-free bipartite graph such that both $G$ and $\bc{G}$ are connected.
	Then $G$ or $\bc{G}$ admits a $k$-chain decomposition for some $k \geq 2$.
\end{theorem}

\begin{lemma}
	\label{lemma: P7 decomp G}
	Let $G=G(X,Y,E)$ be a connected $P_7$-free bipartite graph of chain number $c$ that
	admits a $k$-chain decomposition for some $k \geq 2$. Then there exists
	a partition of $X$ into $p \leq 2(c+1)$ sets $X_1, X_2, \ldots, X_p$, and
	a partition of $Y$ into $q \leq 2(c+1)$ sets $Y_1, Y_2, \ldots, Y_q$ such that, for any $i
  \in [p], j \in [q]$,
	\[
	\ch(G[X_i, Y_j]) <  \ch(G) \,.
	\]
\end{lemma}
\begin{proof}
	Assume, without loss of generality, that $X$ is partitioned into subsets $A_1, \ldots, A_k, C_1, \ldots, C_k$ and $Y$ is partitioned into subsets $B_1, \ldots, B_k, D_1, \ldots, D_k$ satisfying \cref{def: chain decomp}.
	Since at least one of the sets $A_k, B_k,C_k,D_k$ is non-empty, and
	every vertex in $B_k$ has a neighbour in $A_k$ and every vertex in $D_k$ has a neighbour in $C_k$,
	at least one of $A_k$ and $C_k$ is non-empty. Without loss of generality we assume that $A_k$ is not empty.
	It is straightforward to check by definition that for any vertices $a_2 \in A_2, a_3 \in A_3, \ldots, a_k \in A_k$,
	and $d_1 \in D_1, d_2 \in D_2, \ldots, d_{k-1} \in D_{k-1}$ the subgraph of $G$ induced by
	$\{ a_2, a_3, \ldots, a_k, d_1, d_2, \ldots, d_{k-1} \}$ is isomorphic to $H^{\circ\circ}_{k-1}$, which implies that $k$ is at most $c+1$.
	We also observe that any path from a vertex in $A_1$ to a vertex in $D_1$
	contains at least 4 vertices, and hence $G$ contains $H^{\circ\circ}_2$ and
	$\ch(G) \geq 2$. We split our analysis in two cases.

	\textbf{Case 1.} $k \geq 3$. We will show that for any
	$X' \in \{ A_1, \ldots, A_k, C_1, \ldots, C_k \}$ and $Y' \in \{ B_1, \ldots, B_k\splitaftercomma{,} D_1, \ldots, D_k \}$,
	$\ch(G[X',Y']) < \ch(G)$. Since $\ch(G) \geq 2$, the chain number of a biclique is 1, and the chain number of a co-biclique is 0, we need only to verify pairs of sets that can induce a graph which is neither a biclique nor a co-biclique. By \cref{def: chain decomp}, these are the pairs
	$(A_i, B_i)$, $(C_i, D_i)$  for $i \in [k]$ and $(A_i, B_{i-1})$, $(C_i, D_{i-1})$ for $i \in \{2, \ldots, k\}$.

	We start with the pair $(A_1, B_1)$. Since $D_2$ is anticomplete to $A_1$, and $C_2$ is complete to $B_1$, for any vertex $d_2 \in D_2$ and its neighbour $c_2 \in C_2$ we have that $\ch(G[A_1,B_1]) < \ch(G[A_1 \cup \{ c_2 \}, B_1 \cup \{d_2\}]) \leq \ch(G)$. Similarly, since $D_1$ is complete to all $A_2, A_3, \ldots, A_k$, and $C_1$ is anticomplete to all $B_1, B_2, \ldots, B_k$, addition of a vertex $d_1 \in D_1$ and its neighbour $c_1 \in C_1$ to
	any of the graphs $G[A_i, B_i]$ or $G[A_i, B_{i-1}]$ for $i \in \{2, \ldots, k\}$ strictly increases the chain number of that graph. Symmetric arguments establish the desired conclusion for the pairs of sets
	$(C_i, D_i)$, $i \in [k]$, and $(C_i, D_{i-1})$, $i \in \{2, \ldots, k\}$.

	In this case, $A_1, \ldots, A_k, C_1, \ldots, C_k$ and $B_1, \ldots, B_k, D_1, \ldots, D_k$ are the desired partitions of $X$ and $Y$ respectively.

	\textbf{Case 2.} $k = 2$. Assume first that both $A_2$ and $C_2$ are non-empty.
	Let $c_2$ be a vertex in $C_2$, $d_1$ be a neighbour of $c_2$ in $D_1$ (which exists by \cref{rem:2-chain decomp}), and $c_1$
	be a neighbour of $d_1$ in $C_1$. Since $C_2$ is complete to $B_1$ and $D_1$ is
	anticomplete to $A_1$, $\ch(G[A_1,B_1]) < \ch(G[A_1 \cup \{ c_2 \}, B_1 \cup \{d_1\}]) \leq \ch(G)$.
	Similarly, because $C_1$ is anticomplete to both $B_1$ and $B_2$ and $D_1$ is complete to $A_2$,
	we have that $\ch(G[A_2,B_1]) < \ch(G[A_2 \cup \{ c_1 \}, B_1 \cup \{d_1\}]) \leq \ch(G)$
	and $\ch(G[A_2,B_2]) < \ch(G[A_2 \cup \{ c_1 \}, B_2 \cup \{d_1\}]) \leq \ch(G)$.
	Using symmetric arguments we can show that the chain number of each of
	$G[C_1,D_1]$, $G[C_2,D_1]$, and $G[C_2,D_2]$ is strictly less than the chain number of
	$G$. All other pairs of sets $(X',Y')$, where $X' \in \{ A_1, A_2, C_1, C_2 \}$ and $Y' \in \{ B_1, B_2, D_1, D_2 \}$
	induce either a biclique or a co-biclique, and therefore $\ch(G[X',Y']) < \ch(G)$. In this case, $A_1, A_2, C_1, C_2$ and $B_1, B_2, D_1, D_2$ are the desired partitions of $X$ and $Y$ respectively.

	The case when one of $A_2$ and $C_2$ is empty requires a separate analysis. Assume that $A_2 \neq \emptyset$
	and $C_2 = \emptyset$. The  case when $A_2 = \emptyset$ and $C_2 \neq \emptyset$ is symmetric
	and we omit the details.
	Since $C_2$ is empty, $D_2$ is also empty and therefore $A_1, A_2, C_1$ is a partition of $X$,
	and $B_1, B_2, D_1$ is a partition of $Y$. Let $a_2$ be a vertex in $A_2$, $d_1$ be a vertex in $D_1$,
	and $c_1$ be a neighbour of $d_1$ in $C_1$. Let $B_1'$ be the neighbourhood of $a_2$ in $B_1$ and
	let $B_1'' = B_1 \setminus B_1'$. We claim that  $A_1, A_2, C_1$ and $B_1', B_1'', B_2, D_1$
	are the desired partitions of $X$ and $Y$ respectively.
	All the pairs of sets,
	except $(A_1, B_1')$ and $(A_1, B_1'')$, can be treated as before and we skip the details.
	For $(A_1, B_1')$, we observe that $a_2$ is complete to $B_1'$ and $D_1$ is anticomplete to $A_1$,
	and hence $\ch(G[A_1,B_1']) < \ch(G[A_1 \cup \{ a_2 \}, B_1' \cup \{d_1\}]) \leq \ch(G)$.

	To establish the desired property for $(A_1, B_1'')$, we first observe that by \cref{rem:2-chain decomp}
	every vertex in $A_1$ has a neighbour in common with $a_2$, and therefore every vertex in $A_1$ has
	a neighbour in $B_1'$. If $G[A_1, B_1'']$ is edgeless the property holds trivially.
	Otherwise, let $P \subseteq A_1$ and $Q \subseteq B_1''$ be such that $P \cup Q$ induces a
	$H^{\circ\circ}_s$ in $G[A_1, B_1'']$, where $s \geq 1$ is the chain number of the latter graph.
	Let $x$ be the vertex in $P$ that has degree 1 in $G[P,Q]$, and let $y$ be a neighbour of $x$ in $B_1'$.
	We claim that $y$ is complete to $P$. Indeed, if $y$ is not adjacent to some $x' \in P$, then
	$x', z, x, y, a_2, d_1, c_1$ would induce a forbidden $P_7$, where $z$ is the vertex in $Q$ that is adjacent
	to every vertex in $P$.
	Consequently, $G[P \cup \{ a_2 \}, Q \cup \{ y \}]$ is isomorphic to $H^{\circ\circ}_{s+1}$, and therefore $\ch(G[A_1, B_1'']) < \ch(G)$.
\end{proof}

For two pairs of numbers $(a,b)$ and $(c,d)$ we write $(a,b) \preceq (c,d)$
if $a \leq c$ and $b \leq d$, and we write $(a,b) \prec (c,d)$ if at least one of the
inequalities is strict.

\begin{lemma}
	\label{lemma: P7 decomp GcoG}
	Let $G=G(X,Y,E)$ be a $P_7$-free bipartite graph such that both $G$ and $\bc{G}$ are connected, and
	let $c$ be the chain number of $G$. Then there exists
	a partition of $X$ into $p \leq 2(c+2)$ sets $X_1, X_2, \ldots, X_p$, and
	a partition of $Y$ into $q \leq 2(c+2)$ sets $Y_1, Y_2, \ldots, Y_q$ such that
	for any $i \in[p]$, $j \in [q]$
	$$
		\left( \ch(G_{i,j}), \ch(\bc{G_{i,j}}) \right) \prec  \left( \ch(G), \ch(\bc{G}) \right),
	$$
	where $G_{i,j} = G[X_i, Y_j]$.
\end{lemma}
\begin{proof}
	It is easy to verify that for any $k \geq 2$, the graph $\bc{H^{\circ\circ}_k}$ contains the half graph $H^{\circ\circ}_{k-1}$, which implies that
	$\ch(\bc{G}) \leq \ch(G) + 1 = c + 1$. Furthermore, the bipartite complement of a $P_7$ is again $P_7$,
	and hence the bipartite complement of any $P_7$-free bipartite graph is also $P_7$-free.

	By \cref{thm:P7_chain_dec}, $G$ or $\bc{G}$ admits a $k$-chain decomposition for some $k \geq 2$.
	Therefore, by \cref{lemma: P7 decomp G} applied to either $G$ or $\bc{G}$, there exist
	a partition of $X$ into at most $p \leq 2(c+2)$ sets $X_1, X_2, \ldots, X_p$, and
	a partition of $Y$ into at most $q \leq 2(c+2)$ sets $Y_1, Y_2, \ldots, Y_q$ such that
	either $\ch(G_{i,j}) <  \ch(G)$ holds for any $i \in[p]$, $j \in [q]$,
	or $\ch(\bc{G_{i,j}}) <  \ch(\bc{G})$ holds for any $i \in[p]$, $j \in [q]$.
	This together with the fact that the chain number of an induced subgraph
	of a graph is never larger than the chain number of the graph, implies the lemma.
\end{proof}

We are now ready to specify a decomposition scheme for $P_7$-free bipartite graphs.
Let $G=(X,Y,E)$ be a $P_7$-free bipartite graph of chain number $c$.
Let $\ensuremath{\mathcal{Q}}$ be the family consisting of bicliques and co-bicliques.
We define a $(\ensuremath{\mathcal{Q}},2(c+2))$-decomposition tree $\ensuremath{\mathcal{T}}$ for $G$ inductively as follows.
Let $G_v$ be the induced subgraph of $G$ associated with node $v$ of the decomposition tree and write $X' \subseteq X$, $Y' \subseteq Y$ for its sets of vertices, so $G_v = G[X',Y']$.
Graph $G$ is associated with the root node of $\ensuremath{\mathcal{T}}$.
\begin{itemize}
	\item If $G_v$ belongs to $\ensuremath{\mathcal{Q}}$, then terminate the decomposition, so $v$ is a leaf node ($L$-node) of the decomposition tree.

	\item If $G_v$ does not belong to $\ensuremath{\mathcal{Q}}$ and is disconnected, then $v$ is a $D$-node such
	that the children are the connected components of $G_v$.

	\item If $G_v$ does not belong to $\ensuremath{\mathcal{Q}}$, is connected, and $\bc{G_v}$ is disconnected,
	then $v$ is a $\overline D$-node.
	There are sets $X_1', \dotsc, X_t' \subseteq X'$ and $Y_1', \dotsc, Y_t' \subseteq Y'$
	such that $\bc{G[X_1',Y_1']}, \dotsc,  \bc{G[X_t',Y_t']}$
	are the connected components of $\bc{G_v}$.
	The children of this node are $G[X_1',Y_1'], \dotsc, G[X_t',Y_t']$.

	\item If $G_v$ does not belong to $\ensuremath{\mathcal{Q}}$, and neither $G_v$, nor $\bc{G_v}$ is disconnected,
	then $v$ is a $P$-node.
	Let $X_1', X_2, \ldots, X_p'$ be a partition of $X'$ into $p \leq 2(c+2)$ sets,
	and $Y_1', Y_2, \ldots, Y_q'$ be a partition of $Y'$ into $q \leq 2(c+2)$ sets,
	as in \cref{lemma: P7 decomp GcoG}.
	The children of this node are $G[X_i',Y_j']$, $i \in[p]$, $j \in [q]$.
\end{itemize}

\begin{claim}
	\label{cl: Qk-properties}
	Let $\ensuremath{\mathcal{T}}$ be a decomposition tree as a above, and
	let $G_i = G[X_i, Y_i]$, $i = 1,2,3$, be internal nodes in $\ensuremath{\mathcal{T}}$ such that
	$G_3$ is the parent of $G_2$ which is in turn the parent of $G_1$.
	Then
	\begin{enumerate}[label=\textup{(\arabic*)}]
		\item one of $G_3, G_2$, and $G_1$ is a $P$-node, or $G_i$ is $\overline D$-node and $G_{i-1}$ is a $D$-node for some $i \in \{3,2\}$;
		\item if $G_3$ is a $\overline D$-node and $G_2$ is a $D$-node, then $\ch(G_1) < \ch(G_3)$.
	\end{enumerate}
\end{claim}
\begin{proof}
	We start by proving the first statement. Observe that every child a $D$-node is a connected graph, and therefore
	it is not a $D$-node. Similarly, the bipartite complement of every child of a $\overline D$-node is a connected graph,
	and therefore a $\overline D$-node cannot have a $\overline D$-node as a child.
	Hence, if none of $G_3, G_2, G_1$ is a $P$-node, either $G_3$ is a $\overline D$-node and therefore $G_2$ is a
	$D$-node, or $G_3$ is a $D$-node, in which case $G_2$ is a $\overline D$-node and $G_1$ is a $D$-node.
	In both cases we have a pair of parent-child nodes, where the parent is a $\overline D$-node and the child is
	a $D$-node.

	To prove the second statement, let now $G_3$ be a $\overline D$-node and $G_2$ be a $D$-node, \ie
	$G[X_2,Y_2]$ is disconnected, while $G[X_3,Y_3]$ is connected, but its bipartite complement is disconnected.
	%
	Then there are sets $X'_1 \subseteq X_2 \setminus X_1$ and $Y'_1 \subseteq Y_2 \setminus Y_1$ such that
	$G[X_1',Y_1']$ and $G[X_1,Y_1]$ are connected components of $G[X_2,Y_2]$ and at least one of $X'_1,Y'_1$ is non-empty.
	%
	Also at least one of the sets $X'_2 = X_3 \setminus X_2$ and $Y'_2 = Y_3 \setminus Y_2$ is non-empty,
	and every vertex in $X'_2$ is adjacent in $G$ to every vertex in $Y_2$, and
	every vertex in $Y'_2$ is adjacent in $G$ to every vertex in $X_2$.
	%
	If exactly one of the sets $X'_1$ and $Y'_1$ is non-empty, say $Y'_1$, then $X_2'$ is also non-empty, as otherwise  $G[X_3,Y_3]$ would be disconnected. Hence, any vertices $x' \in X_2'$ and $y' \in Y'_1$
	can augment any half graph $H^{\circ\circ}_k$ in $G[X_1,Y_1]$ into a half graph $H^{\circ\circ}_{k+1}$.
	Consequently, $\ch(G[X_1,Y_1]) < \ch(G[\{ x'\} \cup X_1, \{ y' \} \cup Y_1]) \leq \ch(G_3)$.
	If both sets $X'_1$ and $Y'_1$ are non-empty, the argument is similar and we omit the details.
\end{proof}
\begin{theorem}
	\label{th:P7 labeling}
	Let $\ensuremath{\mathcal{F}}$ be a stable family of $P_7$-free bipartite graphs.
	Then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
	Since $\ensuremath{\mathcal{F}}$ is stable, it does not contain $\ensuremath{\mathcal{C}}^{\circ\circ}$ as a subfamily.
	Let $c$ be the maximum number such that $H^{\circ\circ}_c \in \ensuremath{\mathcal{F}}$,
	and let $G=(X,Y,E)$ be an arbitrary graph from $\ensuremath{\mathcal{F}}$.

	By the above discussion $G$ admits
	a $(\ensuremath{\mathcal{Q}}, 2(c+2))$-decomposition tree, where $\ensuremath{\mathcal{Q}}$ is the family consisting of bicliques and co-bicliques, and every $P$-node $G' = G[X',Y']$ is specified
	by the partition $X_1', \ldots, X_p'$ of $X'$ and the partition $Y_1', \ldots, Y_q'$ of $Y'$
	as in \cref{lemma: P7 decomp GcoG}, where $p$ and $q$ are bounded from above by $2(c+2)$.

	We claim that the depth of such a decomposition tree is at most $6c$.
	To show this we associate with every node $G'$ the pair $\left( \ch(G'), \ch(\bc{G'}) \right)$
	and we will prove that if the length of the path from  the root $G$ to a node $G'$ is at least
	$6c$, then $\ch(G') \leq 1$ or $\ch(\bc{G'}) \leq 1$, which means that $G'$ is either
	a biclique or a co-biclique, and therefore is a leaf node.

	Let $\ensuremath{\mathcal{P}}$ be the path from the root to the node $G'$.
	By \cref{cl: Qk-properties} (1), among any three consecutive nodes of the path,
	there exists a $P$-node, or a pair of nodes labeled with $\overline D$ and $D$ respectively
	such that the $\overline D$-node is the parent of the $D$-node.
	In the former case, by \cref{lemma: P7 decomp GcoG},
	for the child node $H'$ of the $P$-node $H$ on the path $\ensuremath{\mathcal{P}}$, we have
	$\left( \ch(H'), \ch(\bc{H'}) \right) \prec \left( \ch(H), \ch(\bc{H}) \right)$.
	In the latter case, by \cref{cl: Qk-properties} (2), the child of the $D$-node
	on the path $\ensuremath{\mathcal{P}}$ has the chain number strictly less than that of the $D$-node.
	In other words, for every node $H$ in the path $\ensuremath{\mathcal{P}}$ and its ancestor $H'$ at distance
	$3$ from $H$, we have  $\left( \ch(H'), \ch(\bc{H'}) \right) \prec \left( \ch(H), \ch(\bc{H}) \right)$.

	Now, since for the root node $G$ we have $\left( \ch(G), \ch(\bc{G}) \right) \prec (c, c+1)$,
	if $\ensuremath{\mathcal{P}}$ has length at least $6c$, then $\ch(G') \leq 1$ or $\ch(\bc{G'}) \leq 1$, as required.
	The result now follows from \cref{lemma:bipartite decomposition} and a simple observation
	that family $\ensuremath{\mathcal{Q}}$ admits a constant-size equality-based adjacency labeling scheme.
\end{proof}

\section{Interval \& Permutation Graphs}
\label{section:intersection graphs}

In the following section we study \cref{question:main} for subfamilies of interval and permutation
graphs.  Interval graphs are the intersection graphs of intervals on the real line, and are arguably
the most studied families of geometric intersection graphs.
As pointed out in~\cite{Har20}, interval graphs contain the co-chain graphs $\ensuremath{\mathcal{C}}^{\bullet\bullet}$
and hence cannot admit a constant-size PUG. Here we wish to show that the \emph{subfamilies} of
interval graphs that admit constant-size PUG are exactly the \emph{stable} subfamilies; \ie the only
barrier to constant-size adjacency sketches is the \textsc{Greater-Than} subproblem.

\begin{definition}[Interval graph]
A graph $G$ is an \emph{interval graph} if there
exists an \emph{interval realization} $\ell, r : V(G) \to \ensuremath{\mathbb{R}}$ with $\ell(v) \le r(v)$ for all $v\in
V(G)$ so that $u,v\in V(G)$ are adjacent in $G$ if and only if $[\ell(u),r(u)]\cap[\ell(v),r(v)] \ne
\emptyset$.
\end{definition}

The family of interval graphs is a factorial family and it admits a simple $O(\log n)$-bit
adjacency labeling scheme: Fix an interval realization of a given $n$-vertex interval graph
$G$ where all endpoints of the intervals are distinct integers in $[2n]$ and assign
to each vertex a label consisting of the two endpoints of the corresponding interval.

Permutation graphs are another important factorial family of geometric intersection graphs (like
interval graphs, they are a subfamily of segment intersection graphs). They admit a straightforward
$O(\log n)$-bit adjacency labeling scheme that follows from their definition, and so are positive
examples to the IGQ.

\begin{definition}[Permutation Graph]
	A graph $G$ is a \emph{permutation graph} on $n$ vertices if each vertex can be identified with a
	number $i \in [n]$, such that there is a permutation $\pi$ of $[n]$ where $i,j$ are adjacent if and
	only if $i < j$ and $\pi(i) > \pi(j)$.
\end{definition}

We find that restricting to the stable subfamilies of interval or permutation graphs allows for
constant-size PUGs.

\thmintersection*

This theorem follows from \cref{thm:interval graphs} (interval graphs) and \cref{thm:permutation
graphs} (permutation graphs), proved below.

\subsection{Interval Graphs}

The proof will rely on bounding the clique number of interval graphs with bounded chain number.

\begin{lemma}
\label{lem:bounded-clique-number-implies-RL-const}
Let $\ensuremath{\mathcal{F}}$ be a family of interval graphs with bounded clique number, \ie there is a
constant $c$ so that for any graph $G\in\ensuremath{\mathcal{F}}$, the maximal clique size is at most $c$.  Then $\ensuremath{\mathcal{F}}$
admits a constant-size equality-based labeling scheme.
\end{lemma}
\begin{proof}
Any interval graph is \emph{chordal} and the treewidth of a chordal graph is one less its clique
number.  It follows that any interval graph $G$ with clique number at most $c$ has treewidth at most
$c-1$.  Graphs of treewidth $c-1$ have arboricity at most $O(c)$, and therefore, by
\cref{lemma:arboricity}, $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based labeling scheme and an
adjacency sketch of size $O(c)$.
\end{proof}

It is not possible in general to bound the clique number of interval graphs with bounded chain
number, because there may be an arbitrarily large set of vertices realized by identical intervals,
which forms an arbitrarily large clique. Our first step is to observe that, for the purpose of
designing an equality-based labeling scheme, we can ignore these duplicate vertices (called
\emph{true twins} in the literature).

\begin{definition}
For a graph $G = (V,E)$, two distinct vertices $x,y$ are called \emph{twins} if $N(x) \setminus
\{y\} = N(y) \setminus \{x\}$, where $N(x)$, $N(y)$ are the neighbourhoods of $x$ and $y$ in $G$.
Twins $x$ and $y$ are \emph{true twins} if they are adjacent, and \emph{false twins} if they are not
adjacent. The false-twin relation and true-twin relation are equivalence relations.

A graph is \emph{true-twin-free} if it does not contain any vertices $x$, $y$ that are true twins, and
it is \emph{false-twin-free} if it does not contain any vertices $x$, $y$ that are false twins. It
is \emph{twin-free} if it is both true-twin-free and false-twin-free.
\end{definition}

\begin{lemma}
\label{lemma:true-twin reduction}
Let $\ensuremath{\mathcal{F}}$ be any hereditary graph family and let $\ensuremath{\mathcal{F}}'$ be either the set of true-twin free members
of $\ensuremath{\mathcal{F}}$, or the set of false-twin free members of $\ensuremath{\mathcal{F}}$. If $\ensuremath{\mathcal{F}}'$ admits an $(s,k)$-equality based
labeling scheme, then $\ensuremath{\mathcal{F}}$ admits an $(s,k+1)$-equality based labeling scheme.
\end{lemma}
\begin{proof}
We prove the lemma for $\ensuremath{\mathcal{F}}'$ being the true-twin free members of $\ensuremath{\mathcal{F}}$; the proof for the
false-twin free members is similar.  Let $G \in \ensuremath{\mathcal{F}}$. We construct a true-twin-free graph $G' \in
\ensuremath{\mathcal{F}}'$ as follows. Let $T_1, \dotsc, T_m \subseteq V(G)$ be the equivalence classes under the
true-twin relation, so that for any $i$, any two vertices $x,y \in T_i$ are true twins. For each $i \in
[m]$, let $t_i \in T_i$ be an arbitrary element, and let $T = \{t_1, \dotsc, t_m\}$. We claim that
$G[T]$ is true-twin free.

Suppose for contradiction that $t_i$, $t_j$ are true twins in $G[T]$. Let $x \in T_i$, $y \in T_j$.
Since $t_i$, $t_j$ are adjacent in $G[T]$, they are adjacent in $G$. Then $x$ is adjacent to $t_j$
since $x,t_i$ are twins. Since $t_j,y$ are twins, $x$ is adjacent to $y$. So $G[T_i,T_j]$ is a
biclique. Now suppose that $z \in T_k$ for some $k \notin \{i,j\}$, and assume $z$ is adjacent to
$x$. Then $z$ is adjacent to $t_i$ since $x, t_i$ are twins, and $t_i$ is adjacent to $t_k$ since
$z, t_k$ are twins. Since $t_i$, $t_j$ are twins, it also holds that $t_j$ is adjacent to $t_k$ and
to $z$. So $y$ is adjacent to $z$. Then for any $z$ it holds that $x,z$ are adjacent if and only if
$y,z$ are adjacent. So $x,y$ are true twins, for any $x \in T_i, y \in T_j$. But then $T_i \cup T_j$
is an equivalence class under the true-twin relation, which is a contradiction.

Therefore, $G[T]$ is true-twin free and a member of $\ensuremath{\mathcal{F}}$, so $G[T] \in \ensuremath{\mathcal{F}}'$. For any $x \in V(G)$,
assign the label $( p(t_i) \eqLabelSep q(t_i), i )$ where $( p(t_i) \eqLabelSep q(t_i) )$ is the label of $t_i$ in
the equality-based labeling scheme for $\ensuremath{\mathcal{F}}'$, and $i \in [m]$ is the unique index such that $x \in
T_i$. The decoder for $\ensuremath{\mathcal{F}}$ performs the following on labels $( p(t_i) \eqLabelSep q(t_i), i)$ and
$( p(t_j) \eqLabelSep q(t_j), j)$. If $i = j$ output 1; otherwise simulate the decoder for $\ensuremath{\mathcal{F}}'$ on
labels $(p(t_i) \eqLabelSep q(t_j))$ and $(p(t_j) \eqLabelSep q(t_j) )$. For vertices $x,y$ in $G$, if $x,y$ are
true twins then $i=j$ and the decoder outputs 1. Otherwise, the adjacency between $x$ and $y$ is
equivalent to the adjacency between $t_i,t_j$ in $G[T]$, which is computed by the decoder for
$\ensuremath{\mathcal{F}}'$, as desired.
\end{proof}

The true-twin free interval graphs with bounded chain number also have bounded clique number.
\begin{lemma}
\label{lem:interval-graphs-clique-bounds-chain}
Let $G$ be a true-twin free interval graph and let $G$ contain a clique of $c$ vertices.
Then $G$ has chain number at least $\lfloor \sqrt c/2\rfloor$.
\end{lemma}
\begin{proof}
Since $G$ is interval, there is an interval realization $\ell, r : V(G) \to \ensuremath{\mathbb{R}}$ with $\ell(v)\le r(v)$
for all $v\in V(G)$ so that $u,v\in V(G)$ are adjacent if and only if
$[\ell(u),r(u)]\cap[\ell(v),r(v)] \ne \emptyset$.  We can assume without loss of generality
that no two endpoints are the same. We abbreviate $i(v)= [\ell(v),r(v)]$.

	Let $X = \{x_1,\ldots,x_c\}$ be the $c$ vertices that form a $c$-clique in $G$,
	arranged so that $\ell(x_1)< \ell(x_2)<\cdots< \ell(x_c)$.
	Consider the sequence $r = (r(x_1),\ldots,r(x_c))$ of right endpoints.
	By the Erdős-Szekeres theorem \cite{ES35}, any sequence of at least $R(k) = (k-1)^2 + 1$ distinct numbers contains
	either an increasing or a decreasing subsequence of length at least $k$.
	Setting $k=\lfloor \sqrt c\rfloor$, we have $R(k) \le c$,
	so there is a clique over $k$ vertices $y_1,\ldots,y_k$ with $\ell(y_1)<\cdots<\ell(y_k)$
	and either $r(y_1)<\cdots<r(y_k)$ or $r(y_1)>\cdots>r(y_k)$.
	Graphically speaking, the intervals for $y_1,\ldots,y_k$ either form a staircase or a (step) pyramid.
	In either case, $\ell(y_k) < \min\{r(y_1),r(y_k)\}$, so
	$m = (\min\{r(y_1),r(y_k)\} + \ell(y_k))/2$ is contained in all $i(y_j)$.
	We will assume the staircase case, $r(y_1)<\cdots<r(y_k)$;
	see \cref{fig:interval-graphs-clique-bounds-chain}.
	The pyramid case is similar.

	\begin{figure}[tbhp]
		\centering
		\begin{tikzpicture}[
			xscale=.8,yscale=1.2,
			noty/.style={blue!80!black,dashed,opacity=.4,|-|},
			yline/.style={blue!80!black,|-|},
			aline/.style={blue!80!black,very thick,|-|},
			zline/.style={red!60!black,|-|},
			bline/.style={red!60!black,very thick,|-|},
			]
			\foreach [count=\i] \r/\s in {5/yline,6/aline,4/noty,7/yline,1/noty,2/noty,8/aline,3/noty,9/aline} {
				\draw[\s] (\i-10,-\i/2) coordinate[label={left,scale=.55:$\ell(x_{\i})$}] (l\i)
				-- (\r,-\i/2) coordinate[label={right,scale=.55:$r(x_{\i})$}] (r\i) ;
			}
			\draw[ultra thick,dotted,gray] (0,0) -- ++(0,-5) node[below] {$m$};
			\foreach [count=\j] \r/\i/\a in {5/1/,6/2/{=a_1},7/4/,8/7/{=a_2},9/9/{=a_3}} {
				\node[scale=.75,yline,anchor=south west] at (0.25,-\i/2) {$y_\j\a$} ;
			}
			\foreach [count=\j] \zl/\zr/\y/\s/\b in
			{5.5/8.5/1/bline/=b_1,%
				-10+2.75/-10+2.25/2/zline/,%
				7.5/11/6/bline/=b_2,%
				8.5/10/7/bline/=b_3%
			} {
				\draw[\s] (\zl,-\y/2-.25) -- node[above,scale=.75] {$z_{\j}\b$} (\zr,-\y/2-.25) ;
			}
		\end{tikzpicture}
		\caption{%
			Example illustrating the notation from the proof of \cref{lem:interval-graphs-clique-bounds-chain}.
			The fat blue and red intervals, $a_1,\ldots,a_3$ resp.\ $b_1,\ldots,b_3$,
			form an induced subgraph with chain number\xspace 3.
		}
		\label{fig:interval-graphs-clique-bounds-chain}
	\end{figure}

	Now, since $G$ is true-twin free, for every $v,v'\in X$, there must be $u\in V(G)$ with
	$i(v)\cap i(u)=\emptyset$ and $i(v')\cap i(u)\ne \emptyset$ or vice versa, so
	$i(u)$ must lie entirely to the left or entirely to the right of $i(v)$ or $i(v')$.
	In particular, for pair $y_j,y_{j+1}$ with $j\in[k-1]$, there must be $z_j\in V(G)$
	adjacent to exactly one of these vertices.
	So the endpoints of $i(z_j)$ are on the same side of $m$ (``left'' or ``right'' of $m$)
	and the endpoint closer to $m$ must be
	either between $\ell(y_j)$ and $\ell(y_{j+1})$
	or between $r(y_j)$ and $r(y_{j+1})$.

	Among the $k-1$ intervals $i(z_1),\ldots,i(z_{k-1})$, at least $h=\lceil(k-1)/2\rceil$
	are one the same side of $m$.
	Assume the majority is on the right; the other case is similar.
	So for $1\le j_1<\cdots<j_h \le k-1$ intervals $i(z_{j_1}),\ldots,i(z_{j_h})$ are all to the right of $m$.
	Define $B=(b_1,\ldots,b_h) = (z_{j_1},\ldots,z_{j_h})$
	and $A = (a_1,\ldots,a_h) = (y_{j_1+1},\ldots,y_{j_h+1})$.
	By definition,
	$\ell(b_1)<r(a_1)<\ell(b_2)<r(a_2)<\cdots<\ell(b_h)<r(a_h)$,
	so $a_i$ is adjacent to $b_j$ if and only if $j \le i$.
	Hence $G[A,B]$ is isomorphic to $H^{\circ\circ}_h$.
	It is easy to check that
	$h = \lceil (\lfloor\sqrt c\rfloor-1)/2\rceil = \lfloor \sqrt c/2\rfloor$.
\end{proof}

With these preparations, the proof of the main result of this section becomes easy.

\begin{theorem}
\label{thm:interval graphs}
Let $\ensuremath{\mathcal{F}}$  be a stable family of interval graphs.
Then $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based adjacency labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}_n) = O(1)$.
\end{theorem}
\begin{proof}
Since $\ensuremath{\mathcal{F}}$ is stable, we have $\ch(\ensuremath{\mathcal{F}}) = k$ for some constant $k$. Let $\ensuremath{\mathcal{F}}'$ be the set of
true-twin-free members of $\ensuremath{\mathcal{F}}$, and let $G' \in \ensuremath{\mathcal{F}}'$. Then $\ch(G')\leq k$, and hence the clique
number of $G'$ is at most $4(k+1)^2$ by (contraposition of)
\cref{lem:interval-graphs-clique-bounds-chain}. So $\ensuremath{\mathcal{F}}'$ is a family of interval graphs with clique
number bounded by $4(k+1)^2$, and hence by \cref{lem:bounded-clique-number-implies-RL-const}, it
admits a constant-size equality-based labeling scheme (and a size $O(k^2)$ adjacency sketch). By
\cref{lemma:true-twin reduction}, so does $\ensuremath{\mathcal{F}}$.
\end{proof}

\begin{remark}
We obtain an adjacency sketch of size $O(k^2)$ for interval graphs with chain number $k$.  There is
another, less direct proof of the above theorem that uses \emph{twin-width} instead of
\cref{lemma:true-twin reduction}, but does not recover this explicit bound on the sketch size. We
prove in \cref{section:twin-width} that any stable family $\ensuremath{\mathcal{F}}$ with bounded twin-width admits a
constant-size equality-based labeling scheme. Although interval graphs do not have bounded
twin-width, some subfamilies of interval graphs (\eg unit interval graphs) are known to have
bounded twin-width~\cite{BKTW20}. We claim that any stable family of interval graphs has bounded
twin-width.  A sketch of this proof is as follows.
\end{remark}

\begin{proposition}
\label{prop:stable interval twin-width}
Let $\ensuremath{\mathcal{F}}$ be a stable family of interval graphs. Then $\ensuremath{\mathcal{F}}$ has bounded twin-width.
\end{proposition}
\begin{proof}[Proof sketch]
As in \cref{lemma:true-twin reduction}, for any graph $G \in \ensuremath{\mathcal{F}}$ that is not twin-free, we define
equivalence classes $T_1, \dotsc, T_m \subseteq V(G)$ of vertices equivalent under the twin relation
(instead of the true-twin or false-twin relation). By choosing arbitrary representatives $t_i \in
T_i$ and letting $T = \{t_1, \dotsc, t_m\}$, we obtain a graph $G[T]$. This graph is
\emph{not} necessarily twin-free; however, $G[T]$ has fewer vertices than $G$. Repeat this
operation until it terminates at a twin-free graph $G[T']$.

It holds that the twin-width satisfies $\mathsf{tww}(G[T']) = \mathsf{tww}(G)$, which is straightforward to check from
\cref{def:twin width}. By \cref{lem:interval-graphs-clique-bounds-chain}, it holds that the graphs
$G[T']$ obtained in this way have bounded clique number. Then, by the argument in the proof of
\cref{lem:bounded-clique-number-implies-RL-const}, they have bounded treewidth, and therefore
bounded twin-width. Since $\mathsf{tww}(G) = \mathsf{tww}(G[T'])$ we conclude that $\ensuremath{\mathcal{F}}$ has bounded twin-width.
\end{proof}

\subsection{Permutation Graphs}
\label{section:permutation graphs}

\begin{figure}
	\centering

	\begin{tikzpicture}[
		scale=1.2,
		empty/.style={fill=black!30},
		]
		\def\mypoints{%
			{}/right/b0/10/1,%
			{a^{(1)}}/below/a1/6/0,%
			{b^{(1)}}/above/b1/8/2,%
			{a^{(2)}}/left/a2/4.25/1,%
			{b^{(2)}}/above/b2/5/3,%
			{a^{(3)}}/left/a3/2/2.3,%
			{b^{(3)}}/above/b3/3/4.8,%
			{a^{(4)}}/left/a4/0/4.3,%
			{b^{(4)}}/above/b4/1/6,%
			{a^{(5)}}/left/a5/-1/5.
		}
		\foreach \label/\dir/\name/\x/\y in \mypoints {
			\coordinate (\name) at (\x,\y) ;
		}

		\foreach \lower/\upper/\left/\right/\label/\filling in {%
			a1/b4/a5/b0//,%
			a1/a2/a1/b1/A_0/,%
			a1/a2/b1/b0/B_0/,%
			a2/b1/a1/b0/B_1/,%
			a1/b1/a2/a1/A_1/,%
			b1/b2/a2/a1/B_2/,%
			b1/b2/a3/a2/A_2/,%
			b2/b3/a3/a2/B_3/,%
			b2/b3/a4/a3/A_3/,%
			b3/b4/a4/a3/B_4/,%
			b3/b4/a5/a4/A_4/,%
			b1/b4/a1/b0//empty,%
			a1/b1/a5/a2//empty,%
			b2/b4/a2/a1//empty,%
			b1/b2/a5/a3//empty,%
			b3/b4/a3/a2//empty,%
			b2/b3/a5/a4//empty%
		} {
			\draw[thick,\filling] let \p1 = (\lower), \p2 = (\upper), \p3 = (\left), \p4 = (\right)
			in (\x3,\y1) rectangle node {$\label$} (\x4,\y2);
		}

		\foreach \label/\dir/\name/\x/\y in \mypoints {
			\node[vertex,label={[rounded corners=3pt,fill opacity=0,text opacity=1,fill=white,inner sep=2pt,\dir=3pt]$\label$}] at (\x,\y) {};
		}

	\end{tikzpicture}
	\caption{The permutation graph decomposition.}
	\label{fig:permutation graph}
\end{figure}

We will denote by $\prec$ the standard partial order on $\ensuremath{\mathbb{R}}^2$, where $(x_1,x_2) \prec (y_1,y_2)$ if $x_1 \leq y_1$ and $x_2 \leq y_2$ and $(x_1,x_2) \neq (y_1,y_2)$.

The following alternative representation of permutation graphs is well-known (although one should
note that adjacency is sometimes defined as between \emph{incomparable} pairs, instead of comparable
ones -- this is equivalent since the complement of a permutation graph is again a permutation
graph).
\begin{proposition}
	For any permutation graph $G$ there is an injective mapping $\phi : V(G) \to \ensuremath{\mathbb{R}}^2$ such that $x,y
	\in V(G)$ are adjacent if and only if $\phi(x),\phi(y)$ are comparable in the partial order $\prec$.
	This mapping also satisfies the property that no two vertices $x,y$ have $\phi(x)_i=\phi(y)_i$ for
	either $i \in [2]$.
\end{proposition}

We will call this the $\ensuremath{\mathbb{R}}^2$-representation of $G$. From now on we will identify vertices of $G$
with their $\ensuremath{\mathbb{R}}^2$-representation, so that a vertex $x$ of $G$ is a pair $(x_1,x_2) \in \ensuremath{\mathbb{R}}^2$.  For
a permutation graph $G$ with fixed $\ensuremath{\mathbb{R}}^2$-representation, any $i \in [2]$, and any $t_1 < t_2$, we
define
\[
V_i(t_1,t_2) \vcentcolon= \{ x \in V(G) : t_1 < x_i < t_2 \} \,.
\]

We need the following lemma, which gives a condition that allows us to
increment the chain number.

\begin{lemma}
	\label{lemma:increment chain number}
	For a graph $G$ and a set $A \subset V(G)$, suppose $u,v \in V(G) \setminus A$ are vertices such
	that $u$ has no neighbors in $A$, while $v$ is adjacent to $u$ and to every vertex in $A$. Then
	$\ch(G[A \cup \{u,v\}]) > \ch(G[A])$.
\end{lemma}
\begin{proof}
	Suppose $\ch(G[A])=k$ and
	let $\{ a_1, \dotsc, a_k, b_1, \dotsc, b_k\}$ be the vertices such that $a_i,b_j$ are adjacent if
	and only if $i \leq j$. Then set $a_{k+1} = u$ and $b_{k+1} = v$, and verify that
	vertices $\{a_1, \dotsc, a_{k+1}, b_1, \dotsc, b_{k+1}\}$ satisfy \cref{def:chain number}, so
	$\ch(G[A \cup \{u,v\}]) \geq k+1 > \ch(G[A])$.
\end{proof}

\newcommand{H^{\mathrm{tw}}}{H^{\mathrm{tw}}}
A bipartite graph $G = (X,Y,E)$ is called a \emph{chain graph} if it belongs to $\ensuremath{\mathcal{C}}^{{\circ\circ}}$.  Chain graphs are exactly the $2K_2$-free bipartite graphs,
where $2K_2$ is the disjoint union of two edges.

\begin{proposition}
	\label{prop:twinned half-graph}
	For any $t \in \ensuremath{\mathbb{R}}$, any $\ensuremath{\mathbb{R}}^2$-representation of a permutation graph $G$, and for each $i \in [2]$, $G[V_i(-\infty,t),V_i(t,\infty)]$ is a chain graph.
\end{proposition}
\begin{proof}
	Let $V_1(-\infty,t) = \{a^{(1)}, \dotsc, a^{(s)} \}$ and $V_1(t, \infty) = \{b^{(1)}, \dotsc,
	b^{(t)}\}$ where the vertices $\{a^{(i)}\}$ and $\{b^{(i)}\}$ are sorted in increasing order in the
	second coordinate. Since $a^{(i)}_1 < t < b^{(j)}_1$ for every $i,j$, it holds that
	$a^{(i)},b^{(j)}$ are adjacent if and only if $a^{(i)}_2 \leq b^{(j)}_2$.
	To prove the statement we will show that $G[V_i(-\infty,t),V_i(t,\infty)]$ is $2K_2$-free.
	Suppose, towards a contradiction, that $a^{(i_1)}, a^{(i_2)}, b^{(j_1)}, b^{(j_2)}$ induce a $2K_2$ in the graph,
	where $a^{(i_1)}$ is adjacent to $b^{(j_1)}$ and $a^{(i_2)}$ is adjacent to $b^{(j_2)}$.
	Assume, without loss of generality, that $a_2^{(i_1)} < a_2^{(i_2)}$. Since $a^{(i_2)}$ is adjacent to $b^{(j_2)}$,
	we have that $a_2^{(i_2)} \leq b_2^{(j_2)}$, which together with the previous inequality imply that
	$a_2^{(i_1)} < b_2^{(j_2)}$, and hence $a^{(i_1)}$ is adjacent to $b^{(j_2)}$, a contradiction.
\end{proof}

Any subfamily of $\ensuremath{\mathcal{C}}^{{\circ\circ}}$ has a constant-size adjacency labeling scheme, because
$\ensuremath{\mathcal{C}}^{{\circ\circ}}$ is a minimal factorial family. We give an explicit bound on the size of the labeling
scheme, so that we can get an explicit bound on the size of the labels for permutation graphs.
\begin{proposition}
\label{prop:chain-labeling-scheme}
Let $\ensuremath{\mathcal{F}} \subset \ensuremath{\mathcal{C}}^{{\circ\circ}}$ be a hereditary family of chain graphs of chain number at most $k$.
Then $\ensuremath{\mathcal{F}}$ admits an adjacency labeling scheme of size $O(\log k)$.
\end{proposition}
\begin{proof}
Let $G \in \ensuremath{\mathcal{F}}$, so that $G \sqsubset H_r^{{\circ\circ}}$ for some $r \in \ensuremath{\mathbb{N}}$. Then we can partition
$V(G)$ into independent sets $A$ and $B$, such that
the following holds. There is a total order $\prec$ defined on $V(G) = A \cup B$ such that for $a
\in A$ and $b \in B$, $a,b$ are adjacent if and only if $a \prec b$. Then we may identify each $a
\in A$ and each $b \in B$ with a number in $[n]$, such that the ordering $\prec$ is the natural
ordering on $[n]$.

Let $A_1, \dotsc, A_p \subset [n]$ be the set of (non-empty) maximal intervals such that each $A_i
\subseteq A$, and let $B_1, \dotsc, B_q \subseteq [n]$ be the set of (non-empty) maximal intervals
such that each $B_i \subseteq B$. We claim that $p,q \leq k+1$. Suppose for contradiction that $p
\geq k+2$. Since $A_1, \dotsc, A_p$ are maximal, there exist $b_1, \dotsc, b_{p-1} \in B$ such that
$a_1 < b_1 < a_2 < b_2 < \dotsm < b_{p-1} < a_p$, where we choose $a_i \in A_i$ arbitrarily. But
then $\{a_1, \dotsc, a_{p-1}\}, \{b_1, \dotsc, b_{p-1}\}$ is a witness that $\ch(G) \geq p-1 \geq
k+1$, a contradiction. A similar proof shows that $q \leq k+1$.

We construct adjacency labels for $G$ as follows. To each $x \in A$, assign 1 bit to indicate that
$x \in A$, and append the unique number $i \in [k+1]$ such that $x$ belongs to interval $A_i$. To
each $y \in B$, assign 1 bit to indicate that $y \in B$, and append the unique number $j \in [k+1]$
such that $y \in B_j$. It holds that for $x \in A, y \in B$, $x,y$ are adjacent if and only if
$i \leq j$. Therefore, on seeing the labels for $x$ and $y$, the decoder simply checks that $x \in
A$ and $y \in B$ (or vice versa) and outputs 1 if $i \leq j$.
\end{proof}

\begin{definition}[Permutation Graph Decomposition]
	\label{def:permutation decomposition}
	For a permutation graph $G$ with a fixed $\ensuremath{\mathbb{R}}^2$-representation, where $G,\overline G$ are both
	connected, we define the following partition.  Let $a^{(1)}$ be the vertex with minimum $a^{(1)}_2$
	coordinate, and let $b$ be the vertex with maximum $b_2$ coordinate. If $b_1 < a^{(1)}_1$, perform
	the following. Starting at $i=1$, construct the following sequence:
	\begin{enumerate}[label=\textup{(\arabic*)}]
		\item Let $b^{(i)}$ be the vertex with maximum $b^{(i)}_2$ coordinate among vertices with $b^{(i)}_1
		> a^{(i)}_1$.
		\item For $i > 1$, let $a^{(i)}$ be the vertex with minimum $a^{(i)}_1$ coordinate among
		vertices with $a^{(i)}_2 < b^{(i-1)}_2$.
	\end{enumerate}
	Let $\beta$ be the smallest number such that $b^{(\beta+1)}=b^{(\beta)}$ and $\alpha$ the smallest number
	such that $a^{(\alpha+1)}=a^{(\alpha)}$. Define these sets:
	\begin{align*}
		\text{For $2 \leq i \leq \alpha$, define } A_i &\vcentcolon= \{a^{(i+1)}\} \cup
		\left( V_1(a^{(i+1)}_1, a^{(i)}_1) \cap V_2(b^{(i-1)}_2, b^{(i)}_2) \right) \\
		\text{For $2 \leq i \leq \beta$, define } B_i &\vcentcolon= \{b^{(i)}\} \cup
		\left( V_1(a^{(i)}_1, a^{(i-1)}_1) \cap V_2(b^{(i-1)}_2, b^{(i)}_2) \right) \\
		A_1 &\vcentcolon= \{a^{(2)}\} \cup
		\left( V_1(a^{(2)}_1, a^{(1)}_1) \cap V_2(a^{(1)}_2, b^{(1)}_2)\right) \\
		A_0 &\vcentcolon= \{a^{(1)}\} \cup
		\left( V_1(a^{(1)}_1, b^{(1)}_1) \cap V_2(a^{(1)}_2, a^{(2)}_2) \right) \\
		B_1 &\vcentcolon= \{b^{(1)}\} \cup
		\left( V_1(a^{(1)}_1, \infty) \cap V_2(a^{(2)}_2, b^{(1)}_2) \right) \\
		B_0 &\vcentcolon=
		\left( V_1(b^{(1)}_1, \infty) \cap V_2(a^{(1)}_2, a^{(2)}_2) \right) \,.
	\end{align*}
	If $b_1 > a^{(1)}_1$, define the map $\phi : \ensuremath{\mathbb{R}}^2 \to \ensuremath{\mathbb{R}}^2$ as $\phi(x) = (-x_1,x_2)$ and apply
	$\phi$ to each vertex in the $\ensuremath{\mathbb{R}}^2$-representation of $G$; it is easily seen that the result is an
	$\ensuremath{\mathbb{R}}^2$-representation of $\overline G$. Then apply the above process to $\overline G$.
\end{definition}

It is necessary to ensure that $b^{(1)}$ is well-defined, \ie that the set of points $x$ with $x_1
> a^{(1)}_1$ is non-empty, so that the maximum is taken over a non-empty set.
\begin{proposition}
	If $G$ is connected then there exists $x \in V(G)$ such that $x_1 > a^{(1)}_1$.
\end{proposition}
\begin{proof}
	Suppose otherwise. Then every $x \in V(G)$ distinct from $a^{(1)}$ has $x_2 > a^{(1)}_2$ by
	definition, and $x_1 < a^{(1)}_1$. But then $x$ is not adjacent to $a^{(1)}$. So $a^{(1)}$ has no
	neighbors, contradicting the assumption that $G$ is connected.
\end{proof}

\begin{proposition}
	If $G$ is connected and $b_1 < a^{(1)}_1$, then $b^{(1)} \neq b^{(2)}$.
\end{proposition}
\begin{proof}
	Suppose $b^{(2)}=b^{(1)}$. Then $b^{(1)}_2=b^{(2)}_2$ is maximum among all vertices $x$ with $x_1 >
	a^{(2)}_1$, so $b_1 < a^{(2)}_1$. But all vertices $x$ with $x_1 < a^{(2)}_1$ satisfy $x_2 >
	b^{(1)}_2=b^{(2)}_2$, so they cannot have an edge to $V_1(a^{(2)}_1,\infty)$. Both
	$V_1(a^{(2)}_1,\infty)$ and $V_1(-\infty, a^{(2)}_1)$ are non-empty, so the graph is not connected.
\end{proof}

\begin{proposition}
	\label{prop:permutation partition}
	If $G$ is connected, the sets $\{A_i\}_{i=0}^{\alpha}, \{B_i\}_{i=0}^{\beta}$ form a partition of
	$V(G)$.
\end{proposition}
\begin{proof}
	Let $C = \{ x : x_1 \geq a^{(\alpha)}_1, x_2 \leq b^{(\beta)}_2 \}$.  There are no vertices $x$ with
	$x_1 > a^{(\alpha)}_1$ and $x_2 > b^{(\beta)}_2$, since this would contradict the definition of
	$b^{(\beta)}$; likewise, there are no vertices $x$ with $x_1 < a^{(\alpha)}_1$ and $x_2 <
	b^{(\beta)}_2$, since this would contradict the definition of $a^{(\alpha)}$.  Now suppose $x_1 <
	a^{(\alpha)}_1, x_2 > b^{(\beta)}_2$. Then $x$ has no edge to any vertex $y \in C$. Then the set of
	vertices with $x_1 < a^{(\alpha)}_1, x_2 > b^{(\beta)}_2$ must be empty, otherwise $V(G)$ is
	partitioned into $C, V(G) \setminus C$ where $V(G) \setminus C \neq \emptyset$ has no edges to $C$.

	Then we may assume that every vertex $x$ is in $C$; we will show that it belongs to some $A_i$ or
	$B_i$.  We may assume that $x$ has distinct $x_1,x_2$ coordinates from all $a^{(i)}, b^{(i)}$,
	otherwise we would have $x = b^{(i)}$ or $x = a^{(i)}$, so $x$ is an element of some $A_i$ or $B_i$.

	Let $i$ be the smallest number such that $x_2 < b^{(i)}_2$. Suppose $i \geq 2$. By definition it
	must be that $x_1 > a^{(i+1)}_1$. If $x_1 > a^{(i-1)}_1$, then $x_2 < b^{(i-1)}_2$ by definition,
	which contradicts the choice of $i$. So it must be that $a^{(i+1)}_1 < x_1 < a^{(i-1)}_1$ and
	$b^{(i-1)}_2 < x_2 < b^{(i)}_2$. The set of points that satisfy this condition is contained in $A_i
	\cup B_i$. Now suppose $i=1$. Again, it must be that $x_1 > a^{(2)}_1$ by definition, and also
	$a^{(1)}_2 < x_2 < b^{(1)}_2$. The points satisfying these conditions are easily seen to be
	partitioned by $A_0, B_0, A_1, B_1$.
\end{proof}

For any subset $A \subset V(G)$ and any two vertices $u,v \in V(G) \setminus A$, we will say that
$u,v$ \emph{cover} $A$ if $u$ has no edge into $A$ and $v$ is adjacent to $u$ and every vertex in
$A$. Then by \cref{lemma:increment chain number}, if $u,v$ cover $A$, then $\ch(G) > \ch(G[A])$.

\begin{proposition}
	\label{prop:permutation main chain}
	If $G$ is connected and $b_1 < a^{(1)}_1$, then
	for each $D \in \{A_i\}^{\alpha}_{i=0} \cup \{B_i\}_{i=0}^{\beta}$, $\ch(G[D]) < \ch(G)$.
\end{proposition}
\begin{proof}
	Each $x \in B_0$ satisfies $x_1 > b^{(1)}_1 > a^{(1)}_1$ and $a^{(1)}_2 < x_2 < a^{(2)}_2 <
	b^{(1)}_2$, so $b^{(1)}$ has no neighbors in $B_0$ while $a^{(1)}$ is adjacent to $b^{(1)}$ and all
	vertices in $B_0$, so $a^{(1)},b^{(1)}$ cover $B_0$.

	Each $x \in B_1$ satisfies $x_1 > a^{(1)}_1 > b^{(2)}_1 > a^{(2)}_1$ and $a^{(1)}_2 < x_2 <
	b^{(1)}_2 < b^{(2)}$, so $b^{(2)}$ has no neighbors in $B_1$ and $a^{(2)}$ is adjacent $b^{(2)}$ and
	all vertices in $B_1$, so $a^{(2)}, b^{(2)}$ cover $B_1$.

	Each $x \in A_0$ satisfies $b^{(1)}_1 > x_1 \geq a^{(1)}_1 > a^{(2)}_1$ and $x_2 < a^{(2)}_2 <
	b^{(1)}_2$, so $a^{(2)}$ has no neighbors in $A_0$ and $b^{(1)}$ is adjacent to $a^{(2)}$ and all
	vertices in $A_0$, so $a^{(2)}, b^{(1)}$ cover $A_0$.

	Next we show that for any $1 \leq i \leq \alpha$, $A_i$ is covered by $a^{(i)}, b^{(i)}$. By
	definition each $x \in A_i$ satisfies $x_1 < a^{(i)}_1 < b^{(i)}_1$ and $a^{(i)}_2 < b^{(i-1)}_2 <
	x_2 < b^{(i)}_2$, so $a^{(i)}$ has no neighbors in $A_i$ while $b^{(i)}$ is adjacent to $a^{(i)}$
	and all vertices in $A_i$.

	Finally, we show that for any $2 \leq i \leq \beta$, $B_i$ is covered by $a^{(i)}, b^{(i-1)}$. By
	definition each $x \in B_i$ satisfies $a^{(i)}_1 < x_1 < a^{(i-1)}_1 < b^{(i-1)}_1$ and $a^{(i)}_2 <
	b^{(i-1)}_2 < x_2$, so $b^{(i-1)}$ has no neighbors in $B_i$ while $a^{(i)}$ is adjacent
	to $b^{(i-1)}$ and all vertices in $B_i$.
\end{proof}

\begin{lemma}
	\label{lemma:permutation decomposition}
	Let $G \in \ensuremath{\mathcal{P}}$ be any permutation graph. Then one of the following holds:
	\begin{enumerate}[label=\textup{(\arabic*)}]
		\item $G$ is disconnected;
		\item $\overline G$ is disconnected;
		\item There is a partition $V(G) = V_1 \cup \dotsm \cup V_m$ such that:
		\begin{itemize}
			\item $\ch(G[V_i]) < \ch(G)$ for each $i \in [m]$, or $\ch(\overline{G[V_i]}) < \ch(\overline G)$ for each $i \in [m]$;
			\item For each $i \in [m]$, there is a set $J(i) \subset \{ V_t \}_{t \in [m]}$ of at most 4 parts such that
			for each $W \in J(i)$, $G[V_i,W]$ is a chain graph; and
			\item One of the following holds:
			\begin{itemize}
				\item For all $i \in [m]$ and $W \in \{V_t\}_{t \in [m]} \setminus J(i)$, $G[V_i,W]$ is a
				co-biclique; or,
				\item For all $i \in [m]$ and $W \in \{V_t\}_{t \in [m]} \setminus J(i)$, $G[V_i,W]$ is a
				biclique.
			\end{itemize}
		\end{itemize}
	\end{enumerate}
\end{lemma}
\begin{proof}
	Assume $G,\overline G$ are connected. Perform the decomposition of \cref{def:permutation
		decomposition}. We will let $m = \alpha+\beta+2$ and let $V_1, \dotsc, V_m$ be the sets
	$\{A_i\}_{i=0}^\alpha \cup \{B_i\}_{i=0}^\beta$.

	\textbf{Case 1:} $b_1 < a^{(1)}_1$. Then $V_1, \dotsc, V_m$ is a partition due to
	\cref{prop:permutation partition}, and $\ch(G[V_i]) < \ch(G), i \in [m]$ holds by \cref{prop:permutation main
		chain}. For $V_i = A_1$ we define the corresponding set $J(i) = \splitaftercomma{\{ A_0, B_0, B_1, B_2\}}$. Since all
	sets $V_i,V_j$ with $i \neq j$ are separated by a horizontal line or a vertical line, it holds by
	\cref{prop:twinned half-graph} that $G[V_i,V_j]$ is a chain graph. Now let $W \notin J(i)$.
	Observe that all $x \in W$ must satisfy $x_1 < a^{(2)}_1$ and $x_2 > b^{(1)}_2$, so $x$ is not
	adjacent to any vertex in $A_1$. So $G[A_1,W]$ is a co-biclique.

	Now for $V_i \in \{A_0, B_0, B_1\}$, we let $J(i) = \{ A_0, B_0, A_1, B_1\} \setminus V_i$. Similar
	arguments as above hold in this case to show that $G[V_i,W]$ is a co-biclique for each
	$W \notin J(i)$.

	For $V_i = A_j$ for some $j > 1$, we define $J(i) = \{ B_j, B_{j+1} \}$. For any $W \notin J(i)$
	with $W \neq A_j$, it holds either that all $x \in W$ satisfy $x_1 < a^{(i+1)}_1$ and $x_2 >
	b^{(j)}_2$, or that all $x \in W$ satisfy $x_1 \geq a^{(j)}_1$ and $x_2 \leq b^{(j-1)}_2$; in either
	case $x$ is not adjacent to any vertex in $A_j$, so $G[A_j,W]$ is a co-biclique.

	For $V_i = B_j$ for some $j > 1$, we define $J(i) = \{ A_j, A_{j-1} \}$. Similar arguments to the
	previous case show that $G[B_j, W]$ is a co-biclique for each $W \notin J(i), W \neq B_j$. This
	concludes the proof for case 1.

	\textbf{Case 2:} $b_1 > a^{(1)}_1$. In this case we transform the $\ensuremath{\mathbb{R}}^2$-representation of $G$
	using $\phi$ to obtain an $\ensuremath{\mathbb{R}}^2$-representation of $\overline G$ and apply the arguments above to
	obtain $V_1, \dotsc, V_m$ such that $\ch(\overline G[V_i]) < \ch(\overline G)$ for each $i \in [m]$,
	and each $V_j \in \{V_t\}_{t \in [m]} \setminus J(i)$ satisfies that $\overline{G}[V_i,V_j]$ is a
	co-biclique; then $G[V_i,V_j]$ is a biclique as desired.
\end{proof}

\begin{theorem}
\label{thm:permutation graphs}
Let $\ensuremath{\mathcal{F}}$ be a stable subfamily of permutation graphs. Then $\ensuremath{\mathcal{F}}$ admits a constant-size
equality-based labeling scheme, and hence $\mathsf{SK}(\ensuremath{\mathcal{F}}) = O(1)$.
\end{theorem}
\begin{proof}
Since $\ensuremath{\mathcal{F}}$ is stable, we have $\ch(\ensuremath{\mathcal{F}}) = k$ for some constant $k$.

We apply an argument similar to \cref{lemma:bipartite decomposition}. For any $G \in \ensuremath{\mathcal{F}}$, we
construct a decomposition tree where each node is associated with either an induced subgraph of
$G$, or a bipartite induced subgraph of $G$, with the root node being $G$ itself. For each node
$G'$, we decompose $G'$ into children as follows,
\begin{enumerate}
  \item If $G'$ is a chain graph, the node is a leaf node.
  \item If $G'$ is disconnected, call the current node a $D$-node, and let the children $G_1,
    \dotsc, G_t$ be the connected components of $G'$.
  \item If $\overline G'$ is disconnected, call the current node a $\overline D$-node, and let
    $C_1, \dotsc, C_t \subseteq V(G')$ be such that $\overline{G}'[C_i], i \in [t]$ are the connected components of
    $\overline G'$. Define the children to be $G_i = G[C_i], i \in [t]$.
  \item Otherwise construct $V_1, \dotsc, V_m$ as in \cref{lemma:permutation decomposition} and
    let the children be $G[V_i]$ for each $i \in [m]$ and $G[V_i,V_j]$ for each $i,j$ such that $i \in [m]$ and
    $V_j \in J(i)$. Call this node a $P$-node.
\end{enumerate}

We will show that this decomposition tree has bounded depth.  As in the decomposition for bipartite
graphs, on any leaf-to-root path there cannot be two adjacent $D$-nodes or $\overline D$-nodes. As
in the proof of \cref{cl: Qk-properties}, if $G''$ is associated with a $D$-node and its parent $G'$
is associated with a $\overline D$-node, and $G'''$ is any child of $G''$, then $\ch(G') >
\ch(G''')$. On the other hand, if $G''$ is associated with a $\overline D$-node and its parent is
associated with a $D$-node, then $\ch(\overline{G'}) > \ch(\overline{G'''})$.

Now consider any $P$-node associated with $G'$, with child $G''$. By \cref{lemma:permutation
decomposition}, it holds that either $G''$ is a bipartite induced subgraph of $G'$ that is a chain
graph, or $G''$ has $\ch(G'') < \ch(G')$ or $\ch(\overline{G''}) < \ch(\overline{G'})$.  It is easy
to verify that $\ch(\overline{G}) \leq \ch(G)+1$ for any graph $G$. Now, since every sequence
$G''',G'',G'$ of inner nodes along the leaf-to-root path in the decomposition tree must satisfy
$\ch(G''') < \ch(G')$ or $\ch(\overline{G'''}) < \ch(\overline{G'})$ and $\ch(\overline G) \leq
k+1$, it must be that the depth of the decomposition tree is at most $2(2k+1)$.

Now we construct an equality-based labeling scheme. For a vertex $x$, we construct a label at each
node $G'$ inductively as follows.
\begin{enumerate}
  \item If $G'$ is a leaf node, it is a chain graph with chain number at most $k$. We may assign a
    label of size $O(\log k)$ due to \cref{prop:chain-labeling-scheme}.
  \item If $G'$ is a $D$-node with children $G_1, \dotsc, G_t$, append the pair $(D \eqLabelSep i)$ where
    the equality code $i$ is the index of the child $G_i$ that contains $x$, and recurse on $G_i$.
  \item If $G'$ is a $\overline D$-node with children $G_1, \dotsc, G_t$, append the pair
    $(\overline D \eqLabelSep i)$ where the equality code $i$ is the index of the child $G_i$ that
    contains $x$, and recurse on $G_i$.
  \item If $G'$ is a $P$-node, let $V_1, \dotsc, V_m$ be partition of $V(G')$ as in
    \cref{lemma:permutation decomposition}, and for each $i$ let $J(i)$ be the (at most 4) indices
    such that $G'[V_i,V_j]$ is a chain graph when $j \in J(i)$. Append the tuple
    \[
      (P, b, \ell_1(x),\ell_2(x), \ell_3(x), \ell_4(x) \eqLabelSep i, j_1,  j_2,  j_3, j_4)
    \]
    where $b$ indicates whether all $G'[V_i,V_j]$, $j \notin J(i)$ are bicliques or co-bicliques; the equality code $i$ is the index such that $x \in V_i$, the equality codes $j_1,
    \dotsc, j_4$ are the elements of $J(i)$, and $\ell_s(x)$ is the $O(\log k)$-bits adjacency
    label for $x$ in the chain graph $G'[V_i, V_{j_s}]$. Then, recurse on the child
    $G'[V_i]$.
\end{enumerate}
Given labels for $x$ and $y$, which are sequences of the tuples above, the decoder iterates
through the pairs and performs the following. On pairs $(D, i), (D,j)$ the decoder outputs 0 if $i
\neq j$, otherwise it continues. On pairs $(\overline D, i), (\overline D, j)$, the decoder
outputs 1 if $i \neq j$, otherwise it continues. On tuples
\begin{align*}
      (P, b, \ell_1(x),\ell_2(x), \ell_3(x), \ell_4(x) &\eqLabelSep i, j_1,  j_2,  j_3, j_4) \\
      (P, b, \ell_1(y),\ell_2(y), \ell_3(y), \ell_4(y) &\eqLabelSep i', j'_1,  j'_2,  j'_3, j'_4) \,,
\end{align*}
the decoder continues to the next tuple if $i=i'$. Otherwise,
the decoder outputs 1 if $i \notin \{j'_1, \dotsc, j'_4\}$ and $i' \notin \{j_1, \dotsc, j_4\}$
and $b$ indicates that $G'[V_i,V_j]$ are bicliques for $j \notin J(i)$; it outputs 0 if $b$
indicates otherwise. If $i = j'_s$ and $i' = j_t$ then the decoder outputs the adjacency of $x,y$
using the labels $\ell_t(x), \ell_s(y)$. On any tuple that does not match any of the above
patterns, the decoder outputs 0.

Since the decomposition tree has depth at most $2(2k+1)$, each label consists of $O(k)$ tuples.
Each tuple contains at most $O(\log k)$ prefix bits (since adjacency labels for the chain graph with
chain number at most $k$ have size at most $O(\log k)$) and at most $5$ equality codes. So this is
an $( O(k\log k), O(k) )$-equality-based labeling scheme.

The correctness of the labeling scheme follows from the fact that at any node $G'$, if $x,y$
belong to the same child of $G'$, the decoder will continue to the next tuple. If $G'$ is the
lowest common ancestor of $x,y$ in the decomposition tree, then $x$ and $y$ are adjacent in $G$
if and only if they are adjacent in $G'$. If $G'$ is a $D$- or $\overline D$-node then adjacency
is determined by the equality of $i,j$ in the tuples $(D \eqLabelSep i), (D \eqLabelSep j)$ or $(\overline D \eqLabelSep
i), (\overline D \eqLabelSep j)$. If $G'$ is a $P$-node and $i \notin J(i')$ (equivalently, $i' \notin
J(i)$) then adjacency is determined by $b$. If $i \in J(i')$ (equivalently, $i' \in J(i)$) then $i =
j'_s$ and $i' = j_t$ for some $s,t$, and the adjacency of $x,y$ is equivalent to their adjacency in
$G[V_i, V_{i'}] = G[V_{j'_s}, V_{j_t}]$, which is a chain graph, and it is determined by the
labels $\ell_t(x), \ell_s(y)$.
\end{proof}

\begin{remark}
We get an explicit $O(k \log k)$ bound on the size of the adjacency sketch in terms of the chain
number $k$, due to \cref{lemma:eq labeling}; this explicit bound would not arise from the alternate
proof that goes through the twin-width (proper subfamilies of permutation graphs have bounded
twin-width \cite{BKTW20}, so we could apply \cref{thm:twin width}).
\end{remark}

\section{Graph Products}
\label{section:cartesian product}
\begin{figure}[tb]
\centering\input{cartesian_product_figure.tex}
\smallskip
\caption{Small-distance sketch for Cartesian products. Along the bottom are the distances sketches
for $x_i$ (top) and $y_i$ (bottom) for $i=1$ to $d$. Where $x_i=y_i$, the sketches for $x_i$ and
$y_i$ are equal and are colored grey; they cancel out in $Z$ and $z$. Where $x_i \neq y_i$, the
sketch for $x_i$ is in red and the sketch for $y_i$ is in green. For $i \neq j$ where $x_i \neq y_i$
and $x_j \neq y_j$, the sketches for $x_i,y_i$ and $x_j,y_j$ are mapped to different buckets with
high probability (\ie $b(i) \neq b(j)$) and the sketches for $x_i$ and $y_i$ are mapped to
different locations in the same bucket with high probability (\ie $c(i,x_i) \neq c(i,y_i)$).}
\label{fig:cartesian products}
\end{figure}

The Cartesian product is defined as follows.

\begin{definition}[Cartesian Products]
Let $d \in \ensuremath{\mathbb{N}}$ and $G_1,\ldots,G_d$ be any graphs.
The Cartesian product $G_1 \mathbin\square G_2 \mathbin\square \cdots \mathbin\square G_d$ is the graph whose
vertices are the tuples $(v_1, \dotsc, v_d) \in V(G_1)\times\cdots\times V(G_d)$,
and two vertices $v$, $w$ are adjacent if and only if there is exactly one coordinate $i \in [d]$ such that $(v_i,w_i) \in E(G_i)$ and for all $j \neq i$, $v_j=w_j$.

For any set of graphs $\ensuremath{\mathcal{F}}$, we will define the set of graphs $\ensuremath{\mathcal{F}}^\square$ as all graphs obtained by taking a product of graphs in $\ensuremath{\mathcal{F}}$:
\[
  \ensuremath{\mathcal{F}}^\square \vcentcolon= \left\{ G_1 \mathbin\square G_2 \mathbin\square \dotsm \mathbin\square G_d : d \in \ensuremath{\mathbb{N}},
\forall i \in [d]\,\, G_i \in \ensuremath{\mathcal{F}} \right\} \,.
\]
\end{definition}

We prove the following theorem. Note that, unlike adjacency, distances are not necessarily preserved
by taking induced subgraphs, so the distance-$k$ result applies to $\ensuremath{\mathcal{F}}^\square$ instead of its
hereditary closure.

\thmgraphproducts*

We obtain as a corollary the new result that $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ is a factorial family with a
$\poly(n)$-size universal graph, when $\ensuremath{\mathcal{F}}$ is any family with a constant-size PUG (including any
finite family), which follows by \cref{lemma:derandomization} and \cref{prop:knr}.
\begin{corollary}
For any hereditary family $\ensuremath{\mathcal{F}}$ that admits a constant-size PUG (in particular any finite family), the
hereditary family $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ has speed $2^{O(n \log n)}$ and admits a $\poly(n)$-size universal
graph.
\end{corollary}
The following proof is illustrated in \cref{fig:cartesian products}. We remark that a simpler proof
can be obtained using arguments from follow-up work of the first and last authors with Louis Esperet
\cite{EHZ22}.

\begin{proof}[Proof of \cref{thm:cartesian products}]
Let $s(k)$ be the size of the randomized distance $k$ labeling scheme for $\ensuremath{\mathcal{F}}$, and let $D :
\{0,1\}^{s(k)} \times \{0,1\}^{s(k)} \to \{0,1\}$ be its decoder. We may assume that this scheme has error
probability at most $\frac1{10k}$, at the expense of at most an $O(\log k)$ factor increase by
\cref{prop:boosting}. For any $G = G_1 \mathbin\square \dotsm \mathbin\square G_d$ where each $G_i \in \ensuremath{\mathcal{F}}$, we will
construct a distance $k$ labeling for $G$ as follows.

Choose constants $m,t\in\ensuremath{\mathbb{N}}$ with $m \geq 9k^2$, $t \geq 9k$ and $mt\ge 27(k+1)^2$. Then:
\begin{enumerate}
\item For each $i \in [d]$, draw a random labeling $\ell_i : V(G_i) \to \{0,1\}^{s(k)}$ from the
distance $k$ scheme for $G_i$.
\item  For each $i \in [m]$, $j \in [t]$ and each vertex $x \in
G$, initialize a vector $w^{(i,j)}(x) \in \{0,1\}^{s(k)}$ to $\vec 0$ and a bit $W^{(i,j)}(x)$ to 0.
\item For each $i \in [d]$ choose a uniformly random coordinate $b(i) \sim [m]$. For each $i \in
[d]$ and each $v \in V(G_i)$ choose a random coordinate $c(i,v) \sim [t]$.
\item For each $x \in V(G)$, assign the label as follows. For each $i \in [d]$, update
\begin{align*}
  w^{(b(i), c(i,x_i))}(x) &\gets w^{(b(i), c(i,x_i))}(x) \oplus \ell_i(x_i) \\
  W^{(b(i), c(i,x_i))}(x) &\gets W^{(b(i), c(i,x_i))}(x) \oplus 1 \,.
\end{align*}
Then the label for $x$ is $w(x)$, the collection of all vectors $w^{(i,j)}(x)$ and bits $W^{(i,j)}(x)$
for $i \in [m]$, $j \in [t]$.
So the size of the label is $mt \cdot (s(k)+1)$.
\end{enumerate}
The decoder is as follows. On receiving labels $w(x),w(y)$, perform the following:
\begin{enumerate}
\item For each $i \in [m], j \in [t]$, let $z^{(i,j)} = w^{(i,j)}(x) \oplus w^{(i,j)}(y)$ and
$Z^{(i,j)} = W^{(i,j)}(x) \oplus W^{(i,j)}(y)$.
\item If there exists $i \in [m]$ for which the number coordinates $j \in [t]$ such that
$Z^{(i,j)} = 1$ is not in $\{0,2\}$, output $\bot$.
\item If there are at least $2k+1$ pairs $(i,j) \in [m] \times [t]$ such that
$Z^{(i,j)} = 1$, output $\bot$.
\item Otherwise, there are $2q \leq 2k$ pairs
\[
(i_1, (j_1)_1), (i_1, (j_1)_2),
(i_2, (j_2)_1), (i_2, (j_2)_2), \dotsc,
(i_q, (j_q)_1), (i_q, (j_q)_2) \in [m] \times [t]
\]
such that $Z^{(i^*,j^*_1)}=Z^{(i^*,j^*_2)} = 1$ for each of these pairs $(i^*, j^*) \in \{ (i_1,
j_1), \dotsc, (i_q, j_q)\}$.
For each $r \in [q]$, define
\[
  k_r = D(z^{(i_r, (j_r)_1)}, z^{(i_r, (j_r)_2)} ) \in [k] \cup \{\bot\} \,.
\]
If any of these values are $\bot$, output $\bot$. Otherwise output $\sum_{r=1}^q k_r$.
\end{enumerate}
\begin{claim}
\label{claim:product good events}
Let $x,y \in G$ such that there are exactly $q \leq k$ coordinates $I \subseteq [d]$, $|I|
= q$, such that $x_i \neq y_i$ for all $i \in I$.  Then, with probability at least $2/3$, all
of the following events occur:
\begin{enumerate}
\item For all $i \in I$, either $\mathsf{dist}(x_i, y_i) \leq k$ and $\mathsf{dist}(x_i, y_i)
= D(\ell_i(x_i), \ell_i(y_i))$, or $\mathsf{dist}(x_i, y_i) > k$ and $D(\ell_i(x_i), \ell_i(y_i)) =
\bot$;
\item The values $b(i)$, $i \in I$, are all distinct;
\item For all $i \in I$, $c(i, x_i) \neq c(i, y_i)$.
\end{enumerate}
\end{claim}
\begin{proof}[Proof of claim]
By assumption, for any $i \in I$, the probability that $D(\ell_i(x_i),\ell_i(y_i))$ fails to output
$\mathsf{dist}(x_i,y_i)$ (if this is at most $k$) or $\bot$ (if the distance is greater than $k$) is at most
$1/9k$, so by the union bound, the probability that the first event fails to occur is at most
$1/9$.

The probability that event 2 fails to occur is the probability that there exists a distinct pair
$i,j \in I$ such that $b(i)=b(j)$; by the union bound, this is at most $|I|^21/m \leq k^2/m \leq
1/9$.

The probability that there exists $i \in I$ such that $c(i,x_i) = c(i,y_i)$ is at most $|I|/t \leq
k/t \leq 1/9$. Therefore the probability that any one of these events fails to occur is at most $3/9
= 1/3$.
\end{proof}

\begin{claim}
For any $x,y \in G$ such that there are exactly $q \leq k$ coordinates $I \subseteq [d]$, $|I|
= q$, such that $x_i \neq y_i$ for all $i \in I$. Then, if all 3 events in \cref{claim:product
good events} occur, the decoder outputs $\mathsf{dist}(x,y)$ unless there is a coordinate $j$ such that
$\mathsf{dist}(x_j,y_j) > k$, in which case it outputs $\bot$.
\end{claim}
\begin{proof}[Proof of claim]
We first observe that the $2q$ pairs $P = \{(b(i), c(i,x_i)), (b(i), c(i,y_i)) \}_{i \in I}$ are
distinct, because each $b(i)$ is distinct and $c(i,x_i) \neq c(i,y_i)$. First, consider pairs $(b(i),
c(i,x_i)), (b(i), c(i,y_i))$ for $i\in I$. Then, since $b(j) \neq b(i)$ for each $j \in I$ with $j \neq i$, and
$c(i,y_i) \neq c(i,x_i)$, we have
\begin{align*}
  Z^{(b(i), c(i,x_i))} &= W^{(b(i), c(i,x_i))}(x) \oplus W^{(b(i), c(i,x_i))}(y) \\
    &= 1 \oplus \ind{c(i,y_i)=c(i,x_i)}
    \oplus \left(\bigoplus_{j \neq i, b(j) = b(i)} \ind{ c(j,x_j) = c(i,x_i) } \right)
\\	&\phantom{{}={}}\qquad
    \oplus \left(\bigoplus_{j \neq i, b(j) = b(i)} \ind{ c(j,y_j) = c(i,x_i) } \right) \\
    &= 1 \oplus \left(\bigoplus_{j \notin I, b(j) = b(i)} \ind{ c(j,x_j) = c(i,x_i) }
                                                   \oplus \ind{ c(j,y_j) = c(i,x_i) } \right) \\
    &= 1 \oplus \left(\bigoplus_{j \notin I, b(j) = b(i)} \ind{ c(j,x_j) = c(i,x_i) }
                                                   \oplus \ind{ c(j,x_j) = c(i,x_i) } \right) \\
    &= 1 \,.
\end{align*}
Multiplying each indicator $\ind{(b(j),c(j,x_j)) =
(b(i),c(i,x_i))}$ by the vector $\ell_i(x_i)$, and each indicator $\ind{(b(j),c(j,y_j)) =
(b(i),c(i,x_i))}$ by the vector $\ell_i(y_i)$, we obtain the following:
\[
  z^{(b(i), c(i,x_i))} = w^{(b(i),c(i,x_i))} = \ell_i(x_i) \,.
\]
By similar reasoning, $Z^{(b(i), c(i,y_i))} = 1$, and
\[
  z^{(b(i), c(i,y_i))} = w^{(b(i),c(i,y_i))} = \ell_i(y_i) \,.
\]
Now consider any $i'\in[m]$, $j'\in[t]$ such that $(i',j')\notin P$.
If there exists no $i\in[d]$, such that $i' = b(i)$, then
clearly $W^{(i',j')}(x)$ and $W^{(i',j')}(y)$ remain $0$ and $Z^{(i',j')}=0$, so these entries
do not contribute.
Otherwise $i' = b(i)$ for some $i\in[d]$.
If $c(i,x_i) \ne j' \ne c(i,y_i)$, again the label entries are not touched and $Z^{(i',j')}=0$.
Finally, assume $(i',j') = (b(i),c(i,x_i))$.
Clearly $(b(j),c(j,x_j)) \neq (b(i),c(i,x_i))$ for any $j \in I$ since $(i',j') \notin P$;
in particular $i \notin I$. Thus $y_i = x_i$ by assumption.
Then
\begin{align*}
  Z^{(b(i), c(i,x_i))}
  &= W^{(b(i), c(i,x_i))}(x) \oplus W^{(b(i), c(i,x_i))}(y) \\
  &= \left( \bigoplus_{j : b(j)=b(i)} \ind{c(j,x_j)=c(i,x_i)} \right) \oplus
     \left( \bigoplus_{j : b(j)=b(i)} \ind{c(j,y_j)=c(i,x_i)} \right) \\
  &= \left( \bigoplus_{j \notin I: b(j)=b(i)} \ind{c(j,x_j)=c(i,x_i)}
      \oplus \ind{c(j,y_j)=c(i,x_i)} \right) \\
  &= \left( \bigoplus_{j \notin I: b(j)=b(i)} \ind{c(j,x_j)=c(i,x_i)}
      \oplus \ind{c(j,x_j)=c(i,x_i)} \right) = 0 \,.
\end{align*}
Since $x_i=y_i$, also $Z^{(b(i), c(i,y_i))}=0$. We may then conclude that the $2q$ distinct
pairs $P$ are the only pairs $(i,j)$ such that $Z^{(i,j)}=1$. Therefore the decoder will output
\[
  \sum_{i \in I} D\left( w^{(b(i),c(i,x_i))}, w^{(b(i),c(i,y_i))} \right)
  = \sum_{i \in I} D\left( \ell_i(x_i), \ell_i(y_i) \right) \,,
\]
which is $\mathsf{dist}(x,y)$ when each $\mathsf{dist}(x_i,y_i) \leq k$ and $\bot$ otherwise.
\end{proof}
Suppose that $x,y \in V(G)$ have distance at most $k$. Then the above two claims suffice to show
that the decoder will output $\mathsf{dist}(x,y)$ with probability at least $2/3$.

Now suppose that $x,y \in V(G)$ have distance greater than $k$. There are three cases:
\begin{enumerate}
\item There are at least $k+1$ coordinates $i \in [d]$ such that $x_i \neq y_i$. In this case, using
\cref{prop:hamming distance} below (with $\delta=\frac13$, $u=mt$, $n=k+1$, $k=k$) yields
that vector $Z$ has at least $k+1$ 1-valued coordinates
$Z^{(i,j)}$ with probability at least $2/3$, and the decoder will correctly output $\bot$.
\item There are at most $k$ coordinates $i \in [d]$ such that $x_i \neq y_i$, and there is some
coordinate $i$ such that $\mathsf{dist}(x_i,y_i) > k$. Then the above two claims suffice to show that the
decoder will output $\bot$ with probability at least $2/3$, as desired.
\item There are at most $k$ coordinates $i \in [d]$ such that $x_i \neq y_i$, and all coordinates
satisfy $\mathsf{dist}(x_i,y_i) \leq k$. Then the above two claims suffices to show that the decoder will
output $\mathsf{dist}(x,y)$ with probability at least $2/3$.
\end{enumerate}
This concludes the proof.
\end{proof}

\ignore{
\begin{theorem}
\label{thm:cartesian products}
Let $\ensuremath{\mathcal{F}}$ be any family of graphs with a constant-size PUG (including any finite family). Then the
family $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ has a constant-size PUG.
\end{theorem}

We obtain as a corollary the new result that $\mathsf{cl}(\ensuremath{\mathcal{F}}^\square)$ is a factorial family with a
$\poly(n)$-size universal graph, when $\ensuremath{\mathcal{F}}$ is any family with a constant-size PUG (including any
finite family), which follows by \cref{lemma:derandomization} and \cref{prop:knr}.
\begin{corollary}
For any hereditary family $\ensuremath{\mathcal{F}}$ that admits a constant-size PUG (or any finite family), the
hereditary family $\ensuremath{\mathcal{F}}^\square$ has speed $2^{O(n \log n)}$ and admits a $\poly(n)$-size universal
graph.
\end{corollary}

\begin{proof}[Proof of \cref{thm:cartesian products}]
	We may assume that there is a PUG $U$ for $\ensuremath{\mathcal{F}}$ with constant size and with error probability at
	most $3/4$ (\cref{prop:boosting}); let $p$ be the size of $U$. Assume that the vertices of $U$ are
	labeled with binary strings $u_1, \dotsc, u_p$ of length $1+\ceil{\log(p+1)}$, where (for simplicity
	of the proof) we assume that the first bit of each label has value 1.
	Let $G = G_1 \times \dotsm \times G_d \in \ensuremath{\mathcal{F}}^\square$, where $G_i \in \ensuremath{\mathcal{F}}$ for every $i \in [d]$.
	Denote by $\Phi_i$ the probability distribution over maps $V(G_i) \to V(U)$ that preserves the adjacency of each pair with probability at least $3/4$.

	Consider the following labeling scheme for $\ensuremath{\mathcal{F}}^\square$.
	Let $x \in V(G)$ so that $x = (x_1, \dotsc, x_d)$ where $x_i \in V(G_i)$,
	and let $m \geq 12$.
	\begin{enumerate}
		\item For each $i \in [d]$, choose a random embedding $\phi_i \sim \Phi_i$.
		\item For each $i \in [d]$ and each vertex $v \in V(G_i)$, choose a random number $\ell(i,v) \sim
		[m]$.
		\item For each $x \in V(G)$, assign a label as follows:
		\begin{enumerate}
			\item Initialize $m$ binary strings $s_1, \dotsc, s_m$ of size $1 + \ceil{\log(p+1)}$ so that each $s_i$
			is the all-0 vector.
			\item For each $i \in [d]$, update
			\[
			s_{\ell(i,x_i)} \gets s_{\ell(i,x_i)} \oplus \phi_i(x_i) \,.
			\]
			\item Assign $x$ the label obtained by concatenating $s_1, \dotsc, s_m$.
		\end{enumerate}
	\end{enumerate}
	The labels have size $m\left(1+\ceil{\log(p+1)}\right)$. The decoder is as follows. Let $x,y \in V(G)$, and let
	$a_1, \dotsc, a_m$ and $b_1, \dotsc, b_m$ be the labels for $x$ and $y$ respectively. Then
	\begin{enumerate}
		\item For each $\ell \in [m]$, set $c_\ell = a_\ell \oplus b_\ell$.
		\item If there are at least 3 distinct indices $p,q,r$ such that $c_p,c_q,c_r \neq 0$, output 0
		(\emph{not adjacent}). Also output 0 if there is only 1 non-zero value $c_\ell$.
		\item Otherwise there are exactly 2 distinct $\ell,\ell'$ such that $c_\ell,c_{\ell'} \neq 0$. Treat
		$c_{\ell},c_{\ell'}$
		as the labels of vertices in $U$ and output $U(c_\ell,c_{\ell'})$.
	\end{enumerate}
	We will prove that for any $x,y \in V(G)$, the above labeling scheme will succeed with probability
	at least $2/3$.

	First suppose that $x,y$ are adjacent, so there exists a unique index $i \in [d]$ such that $x_i
	\neq y_i$ and for all $j \neq i, x_j = y_j$; furthermore, $x_i,y_i$ are adjacent in $G_i$. We will
	consider what happens to the final values $c_p$ computed by the decoder during each step (3b) of the
	encoding algorithm. For every $j \neq i$, write $\ell = \ell(j,x_j) = \ell(j,y_j)$ and $\phi_j(x_j)
	= \phi_j(y_j)$, so step (3b) updates $c_\ell$ as follows:
	\[
	c_\ell = a_\ell \oplus b_\ell \gets a_\ell \oplus b_\ell \oplus \phi_j(x_j) \oplus \phi_j(y_j)
	= a_\ell \oplus b_\ell \,.
	\]
	So $c_\ell$ is unchanged. On the other hand, for $x_i,y_i$ which are adjacent, we have
	$U(\phi_i(x_i),\phi_i(y_i))=1$ with probability at least $3/4$. Assume this event occurs. Then since
	$x_i \neq y_i$, we have $\ell(i,x_i) \neq \ell(i,y_i)$ with probability $1-1/m$. Assume this event
	occurs also. Then the update in step (3b) is as follows:
	\begin{align*}
		c_{\ell(i,x_i)} &= a_{\ell(i,x_i)} \oplus b_{\ell(i,x_i)} \gets a_{\ell(i,x_i)} \oplus
		b_{\ell(i,x_i)} \oplus \phi_i(x_i) = c_{\ell(i,x_i)} \oplus \phi_i(x_i)  \\
		c_{\ell(i,y_i)} &= a_{\ell(i,y_i)} \oplus b_{\ell(i,y_i)} \gets a_{\ell(i,y_i)} \oplus
		b_{\ell(i,y_i)} \oplus \phi_i(y_i) = c_{\ell(i,y_i)} \oplus \phi_i(y_i)  \,.
	\end{align*}
	Then, with probability at least $1 - (1/4 + 1/m) \geq 2/3$, the decoder sees exactly two distinct coordinates $\ell_x \vcentcolon= \ell(i,x_i), \ell_y \vcentcolon=
	\ell(i,y_i)$ with nonzero strings $c_{\ell_x} = \phi_i(x_i),c_{\ell_y} = \phi_i(y_i)$ and will
	correctly return $U(\phi_i(x_i),\phi_i(y_i))=1$.

	Now suppose that $x,y$ are not adjacent. In the first case, there is a unique $i \in [d]$ such that
	$x_i \neq y_i$ but $G_i(x_i,y_i) = 0$. In this case, following the above argument, we have that,
	with probability at least $2/3$, the decoder outputs
	$U(\phi_i(x_i),\phi_i(y_i)) = 0$.

	In the second case, there are at least two distinct coordinates $i,j \in [d]$ such that $x_i \neq
	y_i$ and $x_j \neq y_j$. In this case, we want to show that with probability at least $2/3$, the
	decoder sees at least 3 nonzero strings $c_\ell$. A string $c_\ell$ is zero if and only if all codes
	$\phi_k(x_k),\phi_k(y_k)$ for vertices $x_k,y_k$ assigned to $\ell$ sum to 0. By our simplifying
	assumption that all codes start with 1, the probability of this event is bounded by the event that
	the first bit of $c_\ell$ is 0. There are at least four uniformly and independently distributed
	numbers ($\ell(i,x_i),\ell(i,y_i),\ell(j,x_j),\ell(j,y_v)$), so the bound on this probability
	follows by choosing $w=3$ and a sufficiently large constant $m$, and applying \cref{prop:hamming
		distance}, below.
\end{proof}
}

\begin{proposition}
	\label{prop:hamming distance}
	For any $0 < \delta < 1$ and
	any $u,k,n \in \ensuremath{\mathbb{N}}$, where $u \ge \frac{9(k+1)^2}{\delta}$
	and $n > k$ the following holds.  Write $e_i \in \ensuremath{\mathbb{F}}_2^u$ for the $i$th standard basis vector.
	Let $R_1,
	\dotsc, R_n \sim [u]$ be uniformly and independently random.
	Then $\Pr{|e_{R_1} + \dotsm + e_{R_n}| \leq k} < \delta$,
	where $|v|$ is the number of 1-valued coordinates in $v$ and addition is in $\ensuremath{\mathbb{F}}_2^u$.
\end{proposition}
\begin{proof}
	Set $t = \lfloor \frac{1}{3} \sqrt{\delta u} \rfloor$. We first prove the following claim.

	\smallskip
	\noindent
	\textbf{Claim.}
	\textit{For any vector $e\in \ensuremath{\mathbb{F}}_2^u$
	and $S_1, \ldots, S_t \sim [u]$, we have
	$\Pr{|e + e_{S_1} + \dotsm + e_{S_t}| \leq k} < \delta$.}

	\smallskip
	\noindent
	\textit{Proof.} Observe that $t > \frac{1}{3} \sqrt{\delta u} -1 \ge k$, and $t\le \frac{1}{3} \sqrt{\delta u}$.
	Suppose first that $|e| > k + t$. Then $\Pr{|e + e_{S_1} + \dotsm + e_{S_t}| \leq k}  = 0 < \delta$,
	as each of the vectors $e_{S_i}$ can flip at most one coordinate in $e$ from 1 to 0.
	%
	So assume now that $|e| \leq k + t$. For a fixed $i \in [t]$ we have
	$\Pr{|e + e_{S_i}| < |e|} \leq \frac{k + t}{u} \le \frac{2t}u \le \frac{2\sqrt{\delta u}/3}{u} = \frac23\frac{\sqrt{\delta}}{\sqrt{u}}$.
	Then for $A$, the event that $\exists i \in [t] : |e + e_{S_i}| < |e|$, we have $\Pr{A} \leq
	\frac{1}{3}\sqrt{\delta u} \cdot \frac23\frac{\sqrt{\delta}}{\sqrt{u}} < \delta/2$.
	Let further $B$ be the event that $\exists i,j \in [t] : S_i=S_j$; then also
	$\Pr{B} \le \binom t2 \frac{1}{u} \leq \frac{t^2}{2u} < \delta/2$.
	If $A$ and $B$ both do \emph{not} occur, we have
	$|e + e_{S_1} + \dotsm + e_{S_t}| = |e| + |e_{S_1}| + \dotsm + |e_{S_t}| \ge t>k$,
	so $\Pr{|e + e_{S_1} + \dotsm + e_{S_t}| \leq k} \le \Pr{A\cup B} < \delta$,
	which proves the claim. \qed

	\medskip
	\noindent
	To prove the proposition we consider two cases. The first case is when $n \le t$.
	In this case, as above, the probability that there are two distinct $i,j \in [n]$ such
	that $R_i=R_j$ is at most $\binom n2\frac{1}{u} \le {t \choose 2}\frac{1}{u} < \delta/2$.
	If all $R_i$ are different then $|e_{R_1} + \dotsm + e_{R_n}| = n > k$.
	Hence, $\Pr{|e_{R_1} + \dotsm + e_{R_n}| \leq k} < \delta/2 < \delta$.

	The second case is when $n > t$. In this case we apply the above claim with
	$e = e_{R_{1}} + \cdots + e_{R_{n-t}}$ and $S_1 = R_{n-t+1}, \ldots, S_t = R_n$.
\end{proof}

\subsection{Other Graph Products}

There are 3 other common types of graph products \cite{HIK11}: the strong
product, the direct product, and the lexicographic product, defined as follows.

\begin{definition}[Other Graph Products]
Let $G,H$ be any two graphs, and let $d \in \ensuremath{\mathbb{N}}$. For each product $\star \in \{ \boxtimes, \times,
\diamond\}$ defined below, a vertex $v$ in $G \star H$ is a pair $(v_1,v_2) \in V(G) \times V(H)$,
and, inductively, a vertex $v$ in the $d$-wise product $G^{\star d}$ is a tuple $(v_1, \dotsc, v_d)$
with each $v_i \in V(G)$. Adjacency is defined as follows.
\begin{description}
\item[Strong Product:] Two vertices $v,w$ in the strong product $G \boxtimes H$ are adjacent if $v
\neq w$ and for each $i \in [2]$ such that $v_i \neq w_i$, it holds that $(v_i,w_i)$ is an edge in
the respective graph $G$ or $H$. By induction, two vertices $v,w$ in $G^{\boxtimes d}$ are adjacent
when $v \neq w$ and for each $i \in [d]$ such that $v_i \neq w_i$, it holds that $(v_i,w_i) \in
E(G)$.
\item[Direct Product:] Two vertices $v,w$ in the direct product $G \times H$ are adjacent when
$(v_1,w_1) \in E(G)$ and $(v_2,w_2) \in E(H)$. By induction, two vertices $v,w$ in $G^{\times d}$
are adjacent when $(v_i,w_i) \in E(G)$ for each $i \in [d]$.
\item[Lexicographic Product:] Two vertices $v,w$ in the lexicographic product $G \diamond H$ are
adjacent when either $(v_1,w_1) \in E(G)$ or $v_1=w_1$ and $(v_2,w_2) \in E(H)$. By induction, two
vertices $v,w \in G^{\diamond d}$ are adjacent when $v \neq w$ and the smallest $i \in [d]$ such
that $v_i \neq w_i$ satisfies $(v_i,w_i) \in E(G)$.
\end{description}
For any graph product $\star$ and any base graph $G$, we define the family $G^\star \vcentcolon= \mathsf{cl}\{
G^{\star d} : d \in \ensuremath{\mathbb{N}} \}$.
\end{definition}

Unlike the Cartesian products, the families $G^\boxtimes, G^\times, G^\diamond$ may not be stable,
depending on the choice of $G$. We prove the following fact but defer the proof to
\cref{section:graph products proofs}; this boils down to case analysis on the base graph $G$, and
the constant-size PUGs (when possible) are trivial.

\begin{restatable}{proposition}{graphproducts}
\label{prop:other graph products}
Let $\star \in \{\boxtimes, \times, \diamond\}$ be the strong, direct, or lexicographic product.  For
any graph~$G$, the family $G^\star$ admits a constant-size PUG if and only if $G^\star$ is stable.
\end{restatable}

\section{Equality-Based Communication Protocols and Labeling Schemes}
\label{section:equality}

An \emph{equality-based communication protocol} is a deterministic protocol that has access to an
\textsc{Equality} oracle. Specifically, at each step of the protocol, the players can decide to
(exactly) compute an instance of \textsc{Equality} at unit cost. Informally, this means that the
nodes of the communication tree are either standard nodes, as in deterministic two-way
communication, or \textsc{Equality} nodes.  Formally, we define these protocols as follows.

\begin{definition}[Equality-based Communication Protocol]
An \emph{equality-based communication protocol} for a communication problem
$f = (f_n)_{n \in \ensuremath{\mathbb{N}}}$, $f_n : [n] \times [n]\to \{0,1\}$ is a deterministic protocol of the following form. For each $n$ there is a binary
communication tree $T_n$ whose inner nodes are either:
\begin{enumerate}
\item \emph{Communication nodes} of the form $(p, m)$, where $p$ is a symbol in $\{A,B\}$ and $m :
  [n] \to \{0,1\}$; or,
\item \emph{Equality nodes} of the form $(a,b)$, where $a,b : [n] \to \ensuremath{\mathbb{N}}$,
\end{enumerate}
and edges are labeled in $\{0,1\}$. Leaf nodes of the $T$ are labeled with values in $\{0,1\}$. On input
$x,y \in [n]$, the players Alice and Bob perform the following. Each player keeps track of the
current node $c$, which begins at the root of $T$. The protocol proceeds as follows:
\begin{enumerate}
\item If $c$ is a leaf node, the protocol outputs the label of that node.
\item If $c = (p,m)$ is a communication node and $p=A$, then Alice computes $m(x)$ and sends the
  result to Bob, and both players reset $c$ to be the child labeled with edge value $m(x)$. If $p=B$
  then Bob computes $m(y)$ and sends the result to Alice and $c$ becomes the child labeled with edge
  value $m(y)$.
\item If $c = (a,b)$ is an equality node, then $c$ moves to the child labeled with edge value
$\textsc{Eq}[a(x),b(y)]$.
\end{enumerate}
For a communication tree $T$ and inputs $x,y$, we will write $T(x,y)$ for the output of the protocol
$T$.  We will write $\CC^\textsc{Eq}(f_n)$ for the minimum depth of such a tree that computes $f_n$, and
$\CC^\textsc{Eq}(f)$ for the function $n \mapsto \CC^\textsc{Eq}(f_n)$.  The equality-based communication protocol
is \emph{constant-cost} if $\CC^\textsc{Eq}(f) = O(1)$.
\end{definition}

It was observed in \cite{CLV19} that \textsc{Equality} nodes can simulate standard communication
nodes. We include a proof for the sake of clarity.

\begin{proposition}
\label{prop:equality nodes}
For any equality-based communication tree $T$, there is an equality-based communication tree $T'$
with the same depth as $T$, with all nodes being equality nodes, and such that $T'(x,y) = T(x,y)$ on
all inputs $x,y$.
\end{proposition}
\begin{proof}
Consider any node $(p,m)$ in $T$ with $p \in \{A,B\}$. If $p = A$, replace this node with an
equality node $(a,b)$ where $a(x) = m(x)$ and $b(y) = 1$. If $p = B$, replace this node with an
equality node $(a,b)$ where $a(x) = 1$ and $b(y) = m(y)$. We now observe that for any $x,y$,
if $p = A$ then the output of the node is $1$ if and only if $1 = m(x)$, and if $p = B$ then the
output of the node is $1$ if and only if $1 = m(y)$. So the output of this node is the same as the
original nodel $(p,m)$. We may replace each node in the tree in such a way to produce $T'$.
\end{proof}

Recall the definition of equality-based labeling schemes.
\eqlabeling*

\begin{definition}[Diagonal Labeling Scheme]
We call an equality-based labeling scheme $k$-\emph{diagonal} if $s=0$ (so all prefixes are empty,
and we write $p(x) = \bot$) and there is a function $\eta : \{0,1\}^k \to \{0,1\}$ such that the decoder
satisfies $D_{\bot,\bot}(Q_{x,y}) = \eta(Q_{x,y}(1,1),  Q_{x,y}(2,2), \dotsc, Q_{x,y}(k,k))$ for all
$x,y$.
\end{definition}

\begin{proposition}
\label{prop:eq labeling to cc}
Let $\ensuremath{\mathcal{F}}$ be any hereditary graph family. If $\ensuremath{\mathcal{F}}$ admits a constant-size equality-based labeling
scheme, then there is a constant-size equality-based protocol for $\textsc{Adj}_\ensuremath{\mathcal{F}}$.
\end{proposition}
\begin{proof}
Suppose there is a constant-size equality-based labeling scheme for $\ensuremath{\mathcal{F}}$.  For any $G \in \ensuremath{\mathcal{F}}_n$,
we can compute the edge relation $g : [n] \times [n] \to \{0,1\}$ with a protocol as follows. On input
$x$ and $y$, Alice and Bob compute $p(x),p(y)$ and $q_i(x),q_i(y)$ for each $i \in [k]$. Alice sends
$p(x)$ to Bob using $s$ bits of communication, and then using $k^2$ calls to the \textsc{Equality}
oracle, they compute each pair $\textsc{Eq}(q_i(x),q_j(y))$ and construct $Q_{x,y}$. Then Bob outputs
$D_{p(x),p(y)}(Q_{x,y})$.
\end{proof}

\begin{lemma}
\label{lemma:diagonal labeling}
Let $\ensuremath{\mathcal{F}}$ be any hereditary graph family.  If there is a constant-cost equality-based communication
protocol for $\textsc{Adj}_\ensuremath{\mathcal{F}}$, then, for some constant $k$, $\mathsf{bip}(\ensuremath{\mathcal{F}})$ has a $k$-diagonal labeling
scheme.
\end{lemma}
\begin{proof}
We design a labeling scheme for $\mathsf{bip}(\ensuremath{\mathcal{F}})$ as follows. Write $d = \CC^{\textsc{Eq}}(\textsc{Adj}_\ensuremath{\mathcal{F}})$,
which is a constant. For any $G \in \ensuremath{\mathcal{F}}_n$, there is an equality-based communication tree $T$ with
depth at most $d$ that computes adjacency in $G$. Write $\mathsf{bip}(G) = (X,Y,E)$ where $X,Y$ are copies
of the vertex set of $G$.

Order the nodes of $T$ such that each vertex precedes its children, and the subtree below the
0-valued edge precedes the subtree below the 1-valued edge.  By \cref{prop:equality nodes} we may
assume that all nodes in $T$ are equality nodes. We may also assume that the tree is complete, and
that leaf nodes alternate between 0 and 1 outputs in the order just defined.  Let $(a_1,b_1),
\dotsc, (a_t,b_t)$ be the inner nodes of $T$ (which are all equality nodes), in the order just
defined.
\begin{itemize}
\item For each $x \in X$, define the equality codes $q_i(x) = a_i(x)$ for each $i \in [t]$. Set
$q_{t+1}(x) = 0$.
\item For each $y \in Y$, define the equality codes $q_i(x) = b_i(x)$ for each $i \in [t]$. Set
$q_{t+1}(y) = 1$.
\end{itemize}
It holds that $t \leq 2^d$ since all trees have depth at most $d$. We define $\eta : \{0,1\}^{t+1} \to
\{0,1\}$ as the function that, on input $w \in \{0,1\}^{t+1}$, outputs 0 if $w_{t+1}=1$, and otherwise
simulates the decision tree with node $i$ having output $w_i$. (Note that we have assumed that all
trees are complete, with depth $d$, with the same outputs on each leaf, so that the output of the
tree is determined by the output of each node.) Then on input $x \in X, y \in Y$, we get
\begin{align*}
  &\eta\left( \textsc{Eq}(q_1(x), q_1(y)), \dotsc, \textsc{Eq}(q_t(x), q_t(y)), \textsc{Eq}(0,1) \right) \\
  &\qquad= \eta\left( \textsc{Eq}(a_1(x), b_1(y)), \dotsc, \textsc{Eq}(a_t(x), b_t(y)) \textsc{Eq}(0,1) \right)
  = T(x,y)
\end{align*}
which is 1 if and only if $x,y$ is an edge in $\mathsf{bip}(G)$. On inputs $x,y \in X$ or $x,y \in Y$, we
get
\[
  \eta\left( \textsc{Eq}(q_1(x), q_1(y)), \dotsc, \textsc{Eq}(q_t(x), q_t(y)), \textsc{Eq}(0,0) \right)
  = 0
\]
or
\[
  \eta\left( \textsc{Eq}(q_1(x), q_1(y)), \dotsc, \textsc{Eq}(q_t(x), q_t(y)), \textsc{Eq}(1,1) \right)
  = 0
\]
respectively, as desired.
\end{proof}

\subsection{Characterization as Equivalence-Interpretable}

In this section we give a characterization of the graph families that admit constant-size
equality-based labeling schemes (equivalently, constant-cost equality-based communication
protocols). Independently of our work, Hambardzumyan, Hatami, \& Hatami \cite{HHH21eccc} gave a
different characterization of Boolean matrices (\ie bipartite graphs) that admit constant-cost
equality-based communication protocols: they show that any such matrix $M$ is a linear combination
of a constant number of adjacency matrices of bipartite equivalence graphs.

Recall that a graph $G$ is an equivalence graph if it is the disjoint union of cliques, and a
colored bipartite graph $G = (X,Y,E)$ is a bipartite equivalence graph if it is a colored disjoint
union of bicliques.

\begin{definition}\label{def:t-equality-rep}
For a constant $t \in \ensuremath{\mathbb{N}}$, we say that a family $\ensuremath{\mathcal{F}}$ of bipartite graphs is
\emph{$t$-equivalence interpretable\xspace} if there exists a function $\eta : \{0,1\}^t \to \{0,1\}$, such that the
following holds. For every $G =(X,Y,E)$ in $\ensuremath{\mathcal{F}}$, there exists a vertex-pair coloring $\kappa : X
\times Y \to \{0,1\}^t$, where:
	\begin{enumerate}
		\item For every $i \in [t]$, the graph $(X,Y, E_i)$, where $E_i = \{ (x,y) \in X \times Y :
\kappa(x,y)_i = 1 \}$, is a bipartite equivalence graph;
		\item For every $x \in X, y \in Y$, $(x,y) \in E$ if and only if $\eta(\kappa(x,y)) = 1$.
	\end{enumerate}
\end{definition}
\begin{definition}\label{def:strong-t-equality-rep}
For a constant $t \in \ensuremath{\mathbb{N}}$, we say that a family $\ensuremath{\mathcal{F}}$ of graphs is \emph{strongly}
\emph{$t$-equivalence interpretable\xspace} if there exists a function $\eta : \{0,1\}^t \to \{0,1\}$, such that the
following holds. For every $G =(V,E)$ in $\ensuremath{\mathcal{F}}$, there exists a vertex-pair coloring $\kappa : V
\times V \to \{0,1\}^t$, where:
	\begin{enumerate}
    \item $\kappa(x,y) = \kappa(y,x)$ for every pair $x,y$;
		\item For every $i \in [t]$, the graph $(V, E_i)$, where $E_i = \{ (x,y) :
\kappa(x,y)_i = 1 \}$, is an equivalence graph;
		\item For every $x,y \in V$, $(x,y) \in E$ if and only if $\eta(\kappa(x,y)) = 1$.
	\end{enumerate}
\end{definition}

We recall that given a graph $G=(V,E)$, the graph $\mathsf{bip}(G)$ is the bipartite graph $(V_1, V_2, E')$,
where $V_1$ and $V_2$ are two copies of $V$, and for every $x \in V_1$ and $y \in V_2$, $(x,y) \in E'$
if and only if $(x,y) \in E$.

\begin{lemma}
\label{lemma:eq characterization}
A hereditary graph family $\ensuremath{\mathcal{F}}$ has a constant-size equality-based labeling scheme if and only if
$\mathsf{bip}(\ensuremath{\mathcal{F}})$ is $t$-equivalence interpretable for some constant $t$.
\end{lemma}
\begin{proof}
Suppose that $\ensuremath{\mathcal{F}}$ has a constant-size equality-based labeling scheme. By \cref{prop:eq labeling to
cc} and \cref{lemma:diagonal labeling}, $\mathsf{bip}(\ensuremath{\mathcal{F}})$ has a size $t$ diagonal labeling for some
constant $t$. Let $\eta : \{0,1\}^t \to \{0,1\}$ be the function in the diagonal labeling.

Let $G \in \ensuremath{\mathcal{F}}$ so that $\mathsf{bip}(G) \in \mathsf{bip}(\ensuremath{\mathcal{F}})$. Write $\mathsf{bip}(G) = (X,Y,E)$ where $X,Y$ are copies of
the vertices of $G$.  Each vertex $x \in X \cup Y$ has a label of the form $(q_1(x), \dotsc,
q_t(x))$.

For each $i \in [t]$ and $x \in X, y \in Y$, define the color $\kappa(x,y)_i = \textsc{Eq}(q_i(x),q_i(y))$.
Consider the graph with edges $(x,y) \in X \times Y$ if and only if $\kappa(x,y)_i = 1$. Let $x,x'
\in X$ and $y,y' \in Y$ satisfy $\kappa(x,y)_i = \kappa(x',y)_i = \kappa(x',y')_i = 1$, so that
$(x,y,x',y')$ forms a path. Then $q_i(x) = q_i(y) = q_i(x') = q_i(y')$, so $\kappa(x,y')_i=1$ and
$(x,y')$ is an edge. So this graph must be $P_4$-free; \ie it is a bipartite equivalence graph.

Finally, it holds that for any $x \in X, y \in Y$,
\[
  \eta(\kappa(x,y)_1, \dotsc, \kappa(x,y)_t)
  = \eta(\textsc{Eq}(q_1(x),q_1(y)), \dotsc, \textsc{Eq}(q_t(x), q_t(y)))
\]
which is 1 if and only if $x,y$ is an edge in $\mathsf{bip}(G)$.

Now suppose that $\mathsf{bip}(\ensuremath{\mathcal{F}})$ is $t$-equivalence interpretable. It suffices to construct a labeling
scheme for the graphs $\mathsf{bip}(G)$ for $G \in \ensuremath{\mathcal{F}}$. Write $\mathsf{bip}(G) = (X,Y,E)$ and let $\kappa(x,y) \in
\{0,1\}^t$ be the coloring of vertex pairs $x \in X, y \in Y$. For each $i \in [t]$ we let $E_i$ be the
edge set of the equivalence graph such that $(x,y) \in E_i$ if and only if $\kappa(x,y)_i = 1$.
Give an arbitrary numbering to the bicliques in $E_i$ and define $q_i(x)$ to be the number of the
biclique to which $x$ belongs. It then holds that for any $x \in X, y \in Y$,
\[
  \eta(\textsc{Eq}(q_1(x),q_1(y)), \dotsc, \textsc{Eq}(q_t(x),q_t(y)))
  = \eta(\kappa(x,y)_1, \dotsc, \kappa(x,y)_t) \,,
\]
which is 1 if and only if $(x,y)$ is an edge of $\mathsf{bip}(G)$. Therefore we have obtained a $t$-diagonal
labeling scheme.
\end{proof}

\begin{proposition}
\label{prop:bipartite strong eq interpretable}
Let $\ensuremath{\mathcal{F}}$ be a hereditary family of (uncolored) bipartite graphs. If $\mathsf{bip}(\ensuremath{\mathcal{F}})$ is
$t$-equivalence interpretable then $\ensuremath{\mathcal{F}}$ is strongly $(t+1)$-equivalence interpretable.
\end{proposition}
\begin{proof}
Let $\eta : \{0,1\}^t \to \{0,1\}$ be the function that witnesses $\ensuremath{\mathcal{F}}$ as $t$-equivalence interpretable and
consider any bipartite graph $G \in \ensuremath{\mathcal{F}}$ with a fixed bipartition $(X,Y)$ of its vertices.
Then $\mathsf{bip}(G) = (X_1 \cup Y_1, X_2 \cup Y_2, E' \cup
E'')$ is the disjoint union of $G' = (X_1,Y_2,E')$ and $G'' = (X_2,Y_1,E'')$, where $G'$ and
$G''$ are each isomorphic to $G$. By definition of equivalence-interpretable, there
are graphs $B_1, \dotsc, B_t$ with parts $X_1 \cup Y_1$ and $X_2 \cup Y_2$ where each $B_i$ is a
bipartite equivalence graph, and such that each pair $x \in X_1 \cup Y_1, y \in X_2 \cup Y_2$ is an
edge of $\mathsf{bip}(G)$ if and only if
\[
  \eta( B_1(x,y), \dotsc, B_t(x,y) ) = 1,
\]
where $B_i(x,y) = 1$ if $(x,y)$ is an edge in $B_i$, and $B_i(x,y) = 0$ otherwise.
Clearly, each $B_i$ induces a bipartite equivalence graph when restricted the vertices of $G'$. We now consider graphs
$B'_i$ on vertex set $X_1 \cup Y_2$ where $(x,y)$ is an edge if and only if $x,y$ belong to the same
biclique in $B_i$. $B'_i$ is an equivalence graph since it is obtained by taking a disjoint union of
bicliques and connecting every two vertices belonging to one of the bicliques. Now define the graph
$B'_{t+1}$ on vertices $X_1 \cup Y_2$ such that $(x,y)$ is an edge if and only if $x,y \in X_1$ or
$x,y \in Y_2$, so that $B'_{t+1}$ is an equivalence graph. We define the function $\eta' : \{0,1\}^{t+1}
\to \{0,1\}$ by setting $\eta'(w) = 0$ if $w_{t+1} = 1$ and otherwise setting $\eta'(w) = \eta(w_1,
\dotsc, w_t)$. It then holds that for every $(x,y) \in X_1 \times Y_2$,
\[
  \eta'\left( B'_1(x,y), \dotsc, B'_t(x,y), B'_{t+1}(x,y) \right)
  = \eta\left( B_1(x,y), \dotsc, B_t(x,y) \right)
\]
which is 1 if and only if $x,y$ are adjacent in $G'$. On the other hand, for $x,y \in X_1$ or $x,y
\in Y_2$, we have $\eta'\left( B'_1(x,y), \dotsc, B'_t(x,y), B'_{t+1}(x,y) \right) = 0$, so the same
property holds. Consequently, $G'$ is strongly $(t+1)$-equivalence
interpretable. Since $G$ is isomorphic to $G'$, it is also
strongly $(t+1)$-equivalence interpretable.
\end{proof}

\subsection{Cartesian Products Do Not Admit an Equality-Based Labeling Scheme}

We now prove the following theorem from the introduction. This will follow from \cref{thm:eq
labeling}, which proves the same statement for equality-based labeling schemes. This is equivalent,
by \cref{prop:eq labeling to cc}.

\thmequalitycc*

The $d$-dimensional hypercube $H_d$ is the $d$-wise Cartesian product $P_2^{\square d}$ of the
single edge. The family $\ensuremath{\mathcal{H}} = \mathsf{cl}(\{ H_d : d \in \ensuremath{\mathbb{N}} \})$ of induced subgraphs of the hypercubes is
sometimes called the family of \emph{cubical} graphs.  In this section, we will use \cref{lemma:eq
characterization} to prove that the family of cubical graphs does not admit an equality-based
labeling scheme. In our proof, we will employ some results from the literature.  We denote by $C_n$
the $n$-vertex cycle.

\begin{theorem}[\cite{ARSV06}]\label{hypercubeColoring}
	For every $k$ and $\ell \geq 6$, there exists $d_0(k,\ell)$ such that
	for every $d \geq d_0(k,\ell)$, every edge coloring of $H_d$ with $k$
	colors contains a monochromatic \emph{induced}  cycle of length $2 \ell$.
\end{theorem}

For a graph $G$, its \emph{equivalence covering number} $\mathsf{eqc}(G)$ is the minimum number $k$ such
that there exist $k$ equivalence graphs $F_i=(V,E_i), i \in [k]$, whose union $(V, \cup_{i=1}^k
E_i)$ coincides with $G$.

\begin{theorem}[\cite{LNP80,Alon86}]\label{equivalenceCoveringOfCycles}
	For every $n \geq 3$, it holds that $\mathsf{eqc}(\overline{C_n}) \geq \log n - 1$.
\end{theorem}

For two binary vectors $x,y \in \{0,1\}^t$, we write $x \preceq y$ if $x_i \leq y_i$ for all $i \in [t]$, and we also write $x \prec y$ if $x \preceq y$ and $x \neq y$.

\begin{theorem}\label{thm:eq labeling}
	The family $\ensuremath{\mathcal{H}}$ does not admit a constant-size equality-based labeling scheme.
\end{theorem}
\begin{proof}
	Suppose, towards a contradiction, that $\ensuremath{\mathcal{H}}$ admits a constant-size equality-based labeling scheme.
	Then, since $\ensuremath{\mathcal{H}}$ is a family of bipartite graphs, by \cref{lemma:eq characterization} and \cref{prop:bipartite strong eq interpretable}, there exists a $t$ such that $\ensuremath{\mathcal{H}}$ is strongly $t$-equivalence interpretable\xspace.

	Let $k = 2^t$, $\ell = 2^{t+1}$ and let $n \geq n_0(k, \ell)$, where $n_0(k, \ell)$ is the function
	from \cref{hypercubeColoring}.
	Let $V$ and $E$ be the vertex and the edge sets of the hypercube $H_n$ respectively.
	Let $\kappa: V \times V \rightarrow \{0,1\}^t$ and $\eta: \{0,1\}^t
\rightarrow \{0,1\}$ be the functions as in \cref{def:strong-t-equality-rep}
	witnessing that the hypercube $H_n$ is strongly $t$-equivalence interpretable\xspace.
	Color every edge $(a,b)$ of $H_n$ with $\kappa(a,b)$.
	Since the edges of $H_n$ are colored in at most $k = 2^t$ different colors,
	by \cref{hypercubeColoring} it contains a monochromatic
	induced cycle $C = (V', E')$ of length $2 \ell = 2^{t+2}$.
	Let $\kappa^* \in \{0,1\}^t$ be the color of the edges of $C$.

	\medskip
	\noindent
	\textbf{Claim 1.} \emph{For every distinct $a,b \in V'$ that are \emph{not} adjacent in $C$, we have $\kappa^* \prec \kappa(a,b)$.}

	\smallskip
	\noindent
	\emph{Proof.}
	Since every connected component of an equivalence graph is a clique,
	it follows that for every $i \in [t]$,
	$\kappa^*_i = 1$ implies $\kappa(x,y)_i = 1$ for every $x,y \in V'$.
	Hence, $\kappa^* \preceq \kappa(a,b)$.
	Furthermore, since $a$ and $b$ are not adjacent in $C$,
	we have that $\kappa(a,b) \neq \kappa^*$, as otherwise we would have $\eta(\kappa(a,b)) = \eta(\kappa^*) = 1$ and hence $a$ and $b$ would be adjacent. \qed

	\medskip
	\noindent
	Let now $I \subseteq [t]$ be the index set such that $i \in I$ if and only if
	$\kappa^*_i = 0$ and there exist $a,b \in V'$ with $\kappa(a,b)_i = 1$.
	For every $i \in I$ let $F_i = (V', E_i')$, where
	$E_i' = \{ (a,b) ~|~ a,b \in V', \kappa(a,b)_i = 1\}$.
	Clearly, all these graphs are equivalence graphs.
	By construction and Claim 1, we have that the union $\cup_{i \in I} F_i$
	contains none of the edges of $C$ and contains all non-edges of $C$, in other words
	the union coincides with $\overline{C}$. Thus $\mathsf{eqc}(\overline{C}) \leq |I| \leq t$. However, by \cref{equivalenceCoveringOfCycles}, $\mathsf{eqc}(\overline{C}) \geq \log |V'| - 1 \geq t+1$, a contradiction.
\end{proof}

\section{Twin-width}
\label{section:twin-width}
In this section, we prove the following. Twin-width is formally defined in \cref{def:twin width}.

\thmtwinwidth*

To prove the theorem, we will first reduce the problem to bipartite graphs in
\cref{sec:to-bip-graphs}, and then show in \cref{sec:bip-graphs} how to construct a constant-size
equality-based labeling scheme for any stable family of bipartite graphs of bounded twin-width.
In \cref{section:distance sketching} we will generalize the above theorem to first-order labeling
schemes. As a consequence we will obtain an answer to an open problem from~\cite{Har20} about the
existence of constant-size distance sketches for planar graphs.
In \cref{sec:tw-prelim} we provide necessary definitions and notations.

\subsection{Preliminaries}\label{sec:tw-prelim}

Let $G=(V,E)$ be a graph. A pair of disjoint vertex sets $X,Y \subseteq V$ is \emph{pure} if
either $\forall x \in X, y \in Y$ it holds that $(x,y) \in E$,
or $\forall x \in X, y \in Y$ it holds that $(x,y) \not\in E$.

\begin{definition}[Twin-Width]
\label{def:twin width}
An \emph{uncontraction sequence of width $d$} of a graph $G=(V,E)$ is a sequence
$\ensuremath{\mathcal{P}}_1, \dotsc, \ensuremath{\mathcal{P}}_m$ of partitions of $V$ such that:
\begin{itemize}
\item $\ensuremath{\mathcal{P}}_1 = \{ V \}$;
\item $\ensuremath{\mathcal{P}}_m$ is a partition into singletons;
\item For $i = 1, \dotsc, m-1$, $\ensuremath{\mathcal{P}}_{i+1}$ is obtained from $\ensuremath{\mathcal{P}}_i$ by splitting exactly one of the
parts into two;
\item For every part $U \in \ensuremath{\mathcal{P}}_i$ there are at most $d$ parts $W \in \ensuremath{\mathcal{P}}_i$ with $W \neq U$ such
that $(U,W)$ is not pure.
\end{itemize}
The \emph{twin-width} $\mathsf{tww}(G)$ of $G$ is the minimum $d$ such that there is an uncontraction sequence
of width $d$ of $G$.
\end{definition}

\noindent
The following fact, that we need for some of our proofs, uses the notion of first-order (FO) transduction.
We omit the formal definition of FO transductions and refer the interested reader to \eg \cite{GPT21}.
Informally, given a first-order formula $\phi(x,y)$ and a graph $G$, a \emph{first-order (FO) $\phi$-transduction} of $G$ is
a transformation of $G$ to
a graph that is obtained from $G$ by first taking a constant number of vertex-disjoint copies of $G$,
then coloring the vertices of the new graph by a constant number of colors,
then using $\phi$ as the new adjacency relation,
and finally taking an induced subgraph.
An FO $\phi$-transduction of a graph family $\ensuremath{\mathcal{F}}$ is the family of all $\phi$-transductions of graphs in $\ensuremath{\mathcal{F}}$.
A graph family $\ensuremath{\mathcal{G}}$ is an FO-transduction of $\ensuremath{\mathcal{F}}$ if there exists an FO formula $\phi$ so that
$\ensuremath{\mathcal{G}}$ is the $\phi$-transduction of $\ensuremath{\mathcal{F}}$.

\begin{theorem}[\cite{BKTW20,NMP+21}]\label{th:stable-tw-FO}
	Let $\ensuremath{\mathcal{F}}$ be a stable family of bounded twin-width. Then any FO transduction of $\ensuremath{\mathcal{F}}$ is
	also a stable family of bounded twin-width.
\end{theorem}

\subsection{From General Graphs to Bipartite Graphs}\label{sec:to-bip-graphs}

\begin{proposition}\label{prop:Bip-transduction}
	Let $\ensuremath{\mathcal{F}}$ be a family of graphs. Then the family $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ is an FO transduction of $\ensuremath{\mathcal{F}}$.
\end{proposition}
\begin{proof}[Sketch of the proof]
	Let $G=(V,E)$ be a graph in $\ensuremath{\mathcal{F}}$. To obtain the graph $\mathsf{bip}(G)$, we take a disjoint union $G_1 \cup G_2$, where
	$G_1=(V_1,E_1)$ and $G_2 = (V_2, E_2)$ are two copies of $G$,
	and transform this graph using an FO formula $\phi(x,y)$ that does not hold for any pair of vertices
	that belong to the same copy of $G$, and holds for any pair of vertices that are in different copies and whose
	preimages are adjacent in $G$:
	$$
		\phi(x,y) \;=\; \bigl[(x \in V_1 \wedge y \in V_2) \vee (y \in V_1 \wedge x \in V_2)\bigr]
		\wedge \exists y' : M(y,y') \wedge (E_1(x,y') \vee E_2(x,y')),
	$$
	where $M$ is a relation that is true exactly for copies of the same vertex.
	For any induced subgraph of $\mathsf{bip}(G)$, we in addition take an induced subgraph.
\end{proof}

We can argue now that to prove
\cref{thm:twin width} it is enough to establish its special case for the bipartite families.
Indeed, assume that \cref{thm:twin width} holds for the bipartite families and let
$\ensuremath{\mathcal{F}}$ be an arbitrary hereditary stable family of graphs of bounded twin-width.
Then, by \cref{prop:Bip-transduction} and \cref{th:stable-tw-FO},
the family $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ is also stable and has bounded twin-width.
Therefore, by \cref{prop:bip properties} (\ref{item:bip 4}), any constant-size equality-based
labeling scheme for $\mathsf{cl}(\mathsf{bip}(\ensuremath{\mathcal{F}}))$ can be turned into a constant-size equality-based
labeling scheme for $\ensuremath{\mathcal{F}}$.

\subsection{Bipartite Graphs of Bounded Twin-width}\label{sec:bip-graphs}

An \emph{ordered graph} is a graph equipped with a total order on its vertices. We will denote
ordered graphs as $(V,E,\leq)$ and bipartite ordered graphs  as $ (X,Y,E,\leq)$, where $\leq$
is a total order on $V$ and on $X \cup Y$ respectively.
A \emph{star forest} is a graph whose every component is a star.
Let $(X,\leq)$ be a totally-ordered set. A subset $S \subseteq X$ is
\emph{convex} if for every $x,y,z\in X$ with $x \leq y \leq z$, such that $x,z \in S$, it holds also that $y \in S$.

\begin{definition}[Division]
A \emph{division} of an ordered bipartite graph $G = (X,Y,E,\leq)$ is a partition $\ensuremath{\mathcal{D}}$ of $X \cup
Y$ such that each part $P \in \ensuremath{\mathcal{D}}$ is convex and either $P \subseteq X$ or $P \subseteq Y$. We will
write $\ensuremath{\mathcal{D}}^X = \{ P \in \ensuremath{\mathcal{D}} : P \subseteq X \}, \ensuremath{\mathcal{D}}^Y = \{ P \in \ensuremath{\mathcal{D}} : P \subseteq Y \}$.
\end{definition}

\begin{definition}[Quotient Graph]
For any ordered bipartite graph $G = (X,Y,E, \leq)$ and any division $\ensuremath{\mathcal{D}}$, the \emph{quotient graph}
$G/\ensuremath{\mathcal{D}}$ is the bipartite graph $(\ensuremath{\mathcal{D}}^X, \ensuremath{\mathcal{D}}^Y, \ensuremath{\mathcal{E}})$ where $A \in \ensuremath{\mathcal{D}}^X, B \in \ensuremath{\mathcal{D}}^Y$ are
adjacent if and only if there exist $x \in A, y \in B$ such that $(x,y)$ are adjacent in $G$.
\end{definition}

\newcommand{\mathsf{ctww}}{\mathsf{ctww}}
\begin{definition}[Convex Twin-Width]
A \emph{convex uncontraction sequence of width $d$} of an ordered bipartite graph $G = (X,Y,E,\leq)$
is a sequence $\ensuremath{\mathcal{P}}_1, \dotsc, \ensuremath{\mathcal{P}}_m$ of divisions of $X \cup Y$ such that:
\begin{itemize}
\item $\ensuremath{\mathcal{P}}_1 = \{ X, Y \}$;
\item $\ensuremath{\mathcal{P}}_m$ is a division into singletons;
\item For $i = 1, \dotsc, m-1$, the division $\ensuremath{\mathcal{P}}_{i+1}$ is obtained from $\ensuremath{\mathcal{P}}_i$ by splitting
exactly one of the parts into two;
\item For every part $U \in \ensuremath{\mathcal{P}}_i^X$, there are at most $d$ parts $W \in \ensuremath{\mathcal{P}}_i^Y$ such that $(U,W)$
is impure. For every part $W \in \ensuremath{\mathcal{P}}_i^Y$, there are at most $d$ parts $U \in \ensuremath{\mathcal{P}}_i^X$ such that
$(U,W)$ is impure.
\end{itemize}
The \emph{convex twin-width} $\mathsf{ctww}(G)$ is the minimum $d$ such that there is a convex uncontraction
sequence of width $d$ of $G$.
\end{definition}

\begin{lemma}[\cite{GPT21}, Lemmas 3.14 \& 3.15]
\label{lemma:convex twin width}
For any ordered bipartite graph $G, \mathsf{tww}(G) \leq \mathsf{ctww}(G)$. For any bipartite graph $G = (X,Y,E)$,
there is a total order $\leq$ on $X \cup Y$ such that $\mathsf{ctww}((X,Y,E,{\leq})) \leq \mathsf{tww}(G)+1$.
\end{lemma}

\newcommand{\mathsf{qch}}{\mathsf{qch}}
\begin{definition}[Quasi-Chain Number]
Let $G = (X,Y,E)$ be a bipartite graph. The \emph{quasi-chain number} $\mathsf{qch}(G)$ of $G$ is the largest $k$ for which
there exist two sequences $x_1, \dotsc, x_k \in X$ and $y_1, \dotsc, y_k \in Y$ of not necessarily distinct vertices such that for each $i\in [k]$, one of the following holds:
\begin{enumerate}
\item $x_i$ is adjacent to all of $y_1, \dotsc, y_{i-1}$ and $y_i$ is non-adjacent to all of $x_1,
\dotsc, x_{i-1}$; or,
\item $x_i$ is non-adjacent to all of $y_1, \dotsc, y_{i-1}$ and $y_i$ is adjacent to all of $x_1,
\dotsc, x_{i-1}$.
\end{enumerate}
\end{definition}

\begin{lemma}[\cite{GPT21}, Lemma 3.3]
\label{lemma:quasi chain number}
For every bipartite graph $G$,
\[
  \ch(G) \leq \mathsf{qch}(G) \leq 4 \cdot \ch(G) + 4 \,.
\]
\end{lemma}

\begin{definition}[Flip]
A \emph{flip} of a bipartite graph $G = (X,Y,E)$ is any graph $G' = (X,Y,E')$ obtained by choosing
any $A \subseteq X, B \subseteq Y$ and negating the edge relation for every pair $(a,b) \in A \times
B$.

For $q \in \ensuremath{\mathbb{N}}$ and a graph $G$, a graph $G'$ is a \emph{$q$-flip} of $G$ if there is a sequence $G
= G_0, G_1, \dotsc, G_r = G'$ such that $r \leq q$ and for each $i \in [r]$, $G_i$ is a flip of
$G_{i-1}$.
\end{definition}

\begin{lemma}[\cite{GPT21}, Main Lemma]
\label{lemma:gpt21 main}
For all $k,d \in \ensuremath{\mathbb{N}}$, $k,d \geq 2$, there are $r,q \in \ensuremath{\mathbb{N}}$ satisfying the following. Let $G =
(X,Y,E, \leq)$ be an ordered bipartite graph of convex twin-width at most $d$ and quasi-chain number
at most $k$. Then there is a division $\ensuremath{\mathcal{D}}$ of $G$,
sets $\ensuremath{\mathcal{U}}^X_1, \dotsc, \ensuremath{\mathcal{U}}^X_r \subseteq \ensuremath{\mathcal{D}}^X$,
$\ensuremath{\mathcal{U}}^Y_1, \dotsc, \ensuremath{\mathcal{U}}^Y_r \subseteq \ensuremath{\mathcal{D}}^Y$,
and a $q$-flip $G'$ of $G$ such that the following holds for $H \vcentcolon= G' / \ensuremath{\mathcal{D}}$:
\begin{enumerate}
\item For every edge $(A,B)$ of $H$ there exists $i \in [r]$ such that $A\in\ensuremath{\mathcal{U}}^X_i$, $B \in \ensuremath{\mathcal{U}}^Y_i$;
\item For each $i\in[r]$, the graph $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$ is a star forest.
	Moreover, for each star in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$,
	with center $C$ and leaves $K_1, \dotsc, K_m$,
	the quasi-chain number of $G[C \cup K_1 \cup \dotsm \cup K_m]$ is at most $k-1$.
\end{enumerate}
\end{lemma}

\begin{lemma}
\label{lemma:tw bipartite}
Let $\ensuremath{\mathcal{F}}$ be any family of stable bipartite graphs with bounded twin-width. Then $\ensuremath{\mathcal{F}}$ admits a
constant-size equality-based labeling scheme.
\end{lemma}
\begin{proof}
Since $\ensuremath{\mathcal{F}}$ is stable, we have $\ch(\ensuremath{\mathcal{F}}) = k$ and $\mathsf{tww}(\ensuremath{\mathcal{F}})=d$ for some constants $k,d$.\\

\noindent\textbf{Decomposition tree.}
For any $G \in \ensuremath{\mathcal{F}}$, we construct a decomposition tree as follows. Let $k^* = \mathsf{qch}(G)$ which
satisfies $k^* \leq 4 \cdot \mathsf{qch}(G) + 4$ by \cref{lemma:quasi chain number}. The root of the tree is
associated with~$G$. Every node of the tree is associated with an induced subgraph $G'$ of $G$,
defined as follows:

For a node $G' = (X',Y',E')$ with $\mathsf{qch}(G') \leq 1$, we have $\ch(G') \leq \mathsf{qch}(G') \leq 1$ by
\cref{lemma:quasi chain number}, so $G'$ is $P_4$-free.

For a node $G' = (X',Y',E')$ with $\mathsf{qch}(G') = k' > 1$, let $G'_{\leq} = (X',Y',E',\leq)$ be an
ordered bipartite graph with $\mathsf{ctww}(G'_\leq) \leq d+1$, which exists due to \cref{lemma:convex twin
width}. Let $\ensuremath{\mathcal{D}}$ be a division of $G'_\leq$, let $\ensuremath{\mathcal{U}}^X_1, \dotsc, \ensuremath{\mathcal{U}}^X_r \subseteq \ensuremath{\mathcal{D}}^X$, $\ensuremath{\mathcal{U}}^Y_1, \dotsc, \ensuremath{\mathcal{U}}^Y_r \subseteq \ensuremath{\mathcal{D}}^Y$, and let
$F$ be a $q$-flip of $G'_\leq$ such that the following holds for $H = F/\ensuremath{\mathcal{D}}$:
\begin{enumerate}
\item For every edge $(A,B)$ of $H$ there exists $i \in [r]$ such that $A\in \ensuremath{\mathcal{U}}^X_i, B\in \ensuremath{\mathcal{U}}^Y_i$; and
\item For every $i\in[r]$, $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$ is a star forest such that for every star in this forest  with
center $C$ and leaves $K_1, \dotsc, K_m$ we have $\mathsf{qch}(G'[C \cup K_1 \cup \dotsm \cup K_m]) \leq
k'-1$.
\end{enumerate}
The above holds for some $r,q$ determined by \cref{lemma:gpt21 main}. Below we will let $l^*$ be
the maximum value of $r$ over all nodes $G'$.  Note that we may assume that each edge $(A,B)$ of
$H$ appears in at most one set $\ensuremath{\mathcal{U}}_i\vcentcolon= \ensuremath{\mathcal{U}}^X_i\cup\ensuremath{\mathcal{U}}^Y_i$. Otherwise we can remove the leaf incident with $(A,B)$ from all but one set $\ensuremath{\mathcal{U}}_i$ that induce a star forest containing $(A,B)$; each star forest remains a star forest.

The child nodes of $G'$ are the bipartite graphs $G'[C \cup K_1 \cup \dotsm \cup K_m]$ for each star
$(C, K_1, \dotsc, K_m)$ in the star forests induced by the sets $\ensuremath{\mathcal{U}}_i$.
Observe that each child $G''$ has $\mathsf{qch}(G'') < \mathsf{qch}(G')$, so the depth of the tree is at most
$\mathsf{qch}(G) = k^* \leq 4k + 4$.\\

\noindent\textbf{Labeling scheme.}
We will construct labels as follows. For a vertex $x$ and a graph $G$ containing~$x$, we will write
$L(x,G)$ for the label of $x$ obtained by the following recursive labeling scheme. For each node
$G'$ of the decomposition tree, we assign labels to the vertices of $G'$ inductively as follows.
\begin{enumerate}[topsep=4pt,parsep=0pt,partopsep=0pt]
\item If $G'$ is a leaf node, so that $\mathsf{qch}(G') \leq 1$, each $x$ is assigned a label $L(x,G') =
(0,p(x) \eqLabelSep q(x))$, where $(p(x) \eqLabelSep q(x))$ is the constant-size equality-based label in the graph
$G'$, which is a $P_4$-free bipartite graph. Recall that $P_4$-free bipartite graphs are bipartite
equivalence graphs, so there is a simple equality-based labeling scheme.
\item If $G'$ is an inner node, perform the following. Let $\ensuremath{\mathcal{U}}^X_1,\ensuremath{\mathcal{U}}^Y_1, \dotsc, \ensuremath{\mathcal{U}}^X_r,\ensuremath{\mathcal{U}}^Y_r$ be the sets that
induce star forests in $H$. For each $i$, fix an arbitrary numbering $s_i$ to the stars
in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$.
\begin{enumerate}[itemsep=0pt,topsep=4pt,partopsep=0pt]
\item Let $G'_\leq = F_0, F_1, \dotsc, F_{q'} = F$ with $q' \leq q$ be the sequence of flips that
take $G'_\leq$ to $F$. To each vertex $x \in V(G')$ assign a binary vector $f(x) \in \{0,1\}^q$ so that
$f(x)_i = 1$ if and only if $x$ is in the set that is flipped to get $F_i$ from $F_{i-1}$.
\item For each $i \in [r]$, any vertex $x \in V(G')$ belongs to at most one star $S_i = (C, K_1,
\dotsc, K_m)$ in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$. Append the tuple $(1, f(x) \mathbin| s_1(S_1), \dotsc, s_r(S_r))$ where
$s_i(S_i)$ is the number of the star $S_i = (C, K_1, \dotsc, K_m)$ in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$ containing $x$.
Then for each $i \in [r]$, append $L(x, G'_i)$ for $G'_i = G'[C \cup K_1 \cup \dotsc \cup K_m]$
induced by the star $S_i = (C,K_1, \dotsc, K_m)$.
\label{step:star}
\end{enumerate}
\end{enumerate}

\noindent\textbf{Decoder.}
The decoder for this scheme is defined recursively as follows: Given labels $L(x,G)$, $L(y,G)$ for
vertices $x,y$:
\begin{enumerate}[itemsep=0pt,topsep=4pt,partopsep=0pt]
\item If $L(x,G') = (0, p(x) \eqLabelSep q(x))$, $L(y,G') = (0, p(y) \eqLabelSep q(y))$ then output the adjacency of
$x,y$ in $G'$, which is a bipartite equivalence graph, as determined by the labels $(p(x) \eqLabelSep q(x))$, $(p(y) \eqLabelSep q(y))$.
\item If $L(x,G') = (1, f(x) \eqLabelSep s_1(S_1), \dotsc, s_r(S_r))$, $L(y,G') = (1, f(y) \eqLabelSep s_1(S'_1),
\dotsc, s_r(S'_r))$ then let $i$ be the unique value such that $s_i(S_i)=s_i(S'_i)$, if such a
value exists. In this case, output the adjacency of $x$, $y$ as determined from the labels $L(x,G'_i)$,
$L(y,G'_i)$ where $G'_i$ is the child corresponding to star $S_i = S'_i$.
Otherwise, output the parity of
\[
\bigl|\bigl\{i \in [q] : f(x)_i = f(y)_i = 1 \bigr\}\bigr| \,.
\]
\label{step:flip}
\end{enumerate}

\noindent\textbf{Correctness.}
Let $x \in X, y \in Y$ be vertices of $G$.
\begin{claim}
For any node $G' = (X',Y',E') \sqsubset G$
in the decomposition tree, there is at most one child $G'' \sqsubset G'$ such that $x,y \in V(G'')$.
\end{claim}
\begin{proof}[Proof of claim]
Let $F$ be the $q$-flip of $G'_\leq$, let $\ensuremath{\mathcal{D}}$ the division of $G'_\leq$, and write $H = F/\ensuremath{\mathcal{D}}$.
Let $A \subseteq X', B \subseteq Y'$ be the unique sets with $A,B \in \ensuremath{\mathcal{D}}$ such that $x \in A, y \in
B$. Suppose that for some $i \in [r]$ there is a star $\{A, K_1, \dotsc, K_m\} \subseteq \ensuremath{\mathcal{U}}_i$
such that $B \in \{K_1, \dotsc, K_m\}$. Then $(A,B)$ is an edge of $H$ so, by assumption, $(A,B)$
appears in exactly one star forest $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$. $(A,B)$ also appears in exactly one star in
the star forest $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$. So there is exactly one child $G'' = G'[C \cup K_1 \cup \dotsm
\cup K_m]$ that contains both $x$ and $y$.
\end{proof}
It follows from the above claim that there is a unique maximal path $G = G_0, \dotsc, G_t$ in the
decomposition tree, starting from the root, satisfying $x,y \in V(G_i)$ for each $i = 0, \dotsc, t$.

First we prove that the labeling scheme outputs the correct value on $G_t = (X',Y',E')$. If $G_t$ is
a leaf node then this follows from the labeling scheme for $P_4$-free bipartite graphs.  Suppose
$G_t$ is an inner node. Let $A \subseteq X', B \subseteq Y'$ be the unique sets $A, B \in V(H)$ such
that $x \in A, y \in B$. Since $G_0, \dotsc, G_t$ is a maximal path, it must be that there is no $i
\in [r]$ and star $S$ in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$ such that both $A$ and $B$ are nodes of $S$. Then for every $i \in [r]$, let
$S_i,S'_i$ be the (unique) pair of stars in $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$ such that $A \in S_i, B \in S'_i$; since
$A,B$ are not nodes of the same star, we have $S_i \neq S'_i$ so $s_i(S_i) \neq s_i(S'_i)$ in the
labels. So the decoder outputs the parity of
\[
  \bigl|\bigl\{ i \in [q] : f(x)_i = f(y)_i = 1\bigr\}\bigr|.
\]
We show that $x,y$ are not adjacent in $F$. In this case, $x,y$ are adjacent in $G_t$ if and
only if the pair $(x,y)$ is flipped an odd number of times in the sequence $(G_t)_\leq = F_0, F_1,
\dotsc, F_{q'} = F$; this is equivalent to there being an odd number of indices $i \in [q]$ such
that $f(x)_i = f(y)_i$, so the decoder will be correct.
For contradiction, assume that $x,y$ are adjacent in $F$. Then by definition, $(A,B)$ is an edge of
$H$, so $(A,B)$ must belong to some star $S$ in some forest $H[\ensuremath{\mathcal{U}}^X_i,\ensuremath{\mathcal{U}}^Y_i]$. But then $s_i(S_i) = s_i(S'_i)
= s_i(S)$, a contradiction. So $x,y$ are not adjacent in $F$.

Now consider node $G_i$ for $i = 0, \dotsc, t-1$. By definition, there is a child $G_{i+1}$ that
contains both $x$ and $y$, so there exists $j \in [r]$ and a star $S = (C, K_1, \dotsc, K_m)$
in $H[\ensuremath{\mathcal{U}}^X_j,\ensuremath{\mathcal{U}}^Y_j]$ such that $x,y \in C \cup K_1 \cup \dotsm \cup K_m$. Then $s_j(S_j)=s_j(S'_j)=s_j(S)$ so
the decoder will recurse on the child~$G_{i+1}$.
\end{proof}

\subsection{First-Order Labeling Schemes \& Distance Sketching}
\label{section:distance sketching}

In this section we construct sketches for stable graph families of bounded twin-width that replace
the adjacency relation with a binary relation $\phi(x,y)$ on the vertices, that is defined by a
formula $\phi$ in first-order logic. We will call such a sketch a \emph{$\phi$-sketch}.

\medskip
\noindent
\textbf{First-order logic.}
A \textit{relational vocabulary} $\tau$ is a set of relation symbols. Each relation symbol $R$
has an \textit{arity}, denoted $\text{arity}(R) \geq 1$. A \textit{structure} $\mathcal{A}$
of vocabulary $\tau$, or $\tau$-structure,  consists of a set $A$, called the \textit{domain}, and an interpretation
$R^{\mathcal{A}} \subseteq A^{\text{arity(R)}}$ of each relation symbol $R \in \tau$.
To briefly recall the syntax and semantics of first-order logic, we fix a countably
infinite set of \textit{variables}, for which we use small letters.
\textit{Atomic formulas of vocabulary $\tau$} are of the form:
\begin{enumerate}
	\item $x = y$ or
	\item $R(x_1, \ldots, x_r)$, meaning that $(x_1, \ldots, x_r) \in R$,
\end{enumerate}
where $R \in \tau$ is $r$-ary and $x_1, \ldots , x_r, x, y$ are variables.
\textit{First-order (FO) formulas} of vocabulary $\tau$ are inductively defined as either the atomic formulas,
a Boolean combination $\neg\phi$, $\phi\wedge\psi$, $\phi\vee\psi$, or a quantification $\exists
x.\phi$ or $\forall x.\phi$, where $\phi$ and $\psi$ are FO formulas.
A \textit{free variable} of a formula $\phi$ is a variable $x$ with an occurrence in $\phi$
that is not in the scope of a quantifier binding $x$.
We write $\phi(x_1, x_2, \ldots, x_k)$ to show that the set of free variable of $\phi$
is $\{ x_1, x_2, \ldots, x_k \}$.
By $\phi[t/x]$, we denote the formula that results from substituting $t$ for free variable $x$ in $\phi$.

\medskip
\noindent
\textbf{First-order labeling schemes.}
We fix a relational vocabulary $\tau$ that consists of a unique (symmetric) binary relational symbol
$E$, and $t$ unary relational symbols $R_1, \dotsc, R_t$. A $\tau$-structure $\ensuremath{\mathcal{G}}$ with
domain $V$ is a tuple $(V, E^\ensuremath{\mathcal{G}}, R_1^\ensuremath{\mathcal{G}}, \dotsc, R_t^\ensuremath{\mathcal{G}})$ where each $R_i^\ensuremath{\mathcal{G}} \subseteq V$ is an
interpretation of the symbol $R_i$, and $E^\ensuremath{\mathcal{G}} \subseteq V \times V$ is an interpretation of the symbol
$E$.
For a graph family~$\ensuremath{\mathcal{F}}$, we will write $\ensuremath{\mathcal{F}}^\tau$ for the set of $\tau$-structures $\ensuremath{\mathcal{G}} = (V, E^\ensuremath{\mathcal{G}},
R_1^\ensuremath{\mathcal{G}}, \dotsc, R_t^\ensuremath{\mathcal{G}})$ where $(V,E^\ensuremath{\mathcal{G}})$ is a graph in $\ensuremath{\mathcal{F}}$. Let $\phi(x,y)$ be an FO formula of
vocabulary $\tau$. For a $\tau$-structure $\ensuremath{\mathcal{G}} = (V,E^\ensuremath{\mathcal{G}},R_1^\ensuremath{\mathcal{G}},\dotsc,R_t^\ensuremath{\mathcal{G}})$ and $u,v \in V$, we write $\ensuremath{\mathcal{G}} \models \phi[u/x,v/y]$, if $\phi[u/x,v/y]$ is a true statement in $\ensuremath{\mathcal{G}}$.
When the $\tau$-structure is clear from context, we drop the superscript $\ensuremath{\mathcal{G}}$ (and identify the relation symbol and its interpretation in~$\ensuremath{\mathcal{G}}$).

\begin{definition}[First-order sketches]
For a symmetric first-order formula $\phi(x,y)$ with vocabulary $\tau$, and a graph family $\ensuremath{\mathcal{F}}$, a
\emph{$\phi$-sketch} with cost $c(n)$ and error $\delta$ is a pair of algorithms: a randomized
\emph{encoder} and a deterministic \emph{decoder}. The encoder takes as input any $\tau$-structure
$G = (V,E,R_1,\dotsc,R_t) \in \ensuremath{\mathcal{F}}^\tau$ with $|V|=n$ vertices and outputs a (random) function $\mathsf{sk} :
V \to \{0,1\}^{c(n)}$. The encoder and (deterministic) decoder $D : \{0,1\}^* \times \{0,1\}^* \to \{0,1\}$ must
satisfy the condition that for all $G \in \ensuremath{\mathcal{F}}^\tau$,
\[
\forall u,v \in V(G) : \qquad \Pru{\mathsf{sk}}{ \vphantom{\Big|} D\bigl(\mathsf{sk}(u),\mathsf{sk}(v)\bigr) = \ind{G \models \phi[u/x,v/y]} } \;\geq\;
1-\delta \,.
\]
As usual, if left unspecified, we assume $\delta=1/3$.  We will write $\phi$-$\mathsf{SK}(\ensuremath{\mathcal{F}})$ for the
smallest function $c(n)$ such that there is a randomized  $\phi$-labeling scheme for $\ensuremath{\mathcal{F}}$ with cost
$c(n)$ and error $\delta=1/3$. Setting $\delta=0$ we obtain the notion of \emph{(deterministic)
$\phi$-labeling scheme}.
\end{definition}

\begin{theorem}
\label{thm:FO-RL}
Let $\ensuremath{\mathcal{F}}$ be a stable, hereditary graph family with bounded twin-width, and let $\phi(x,y)$ be an FO
formula of vocabulary $\tau$. Then $\phi$-$\mathsf{SK}(\ensuremath{\mathcal{F}}) = O(1)$.
\end{theorem}
\begin{proof}
Given a $\tau$-structure $G=(V,E,R_1,\dotsc,R_t) \in \ensuremath{\mathcal{F}}^\tau$, we denote by $G^{\phi}$ the graph
with vertex set $V$ and the edge set $E^{\phi} = \{ (u,v) : G \models \phi[u/x,v/y] \}$.  We also define
$\ensuremath{\mathcal{F}}^{\phi} := \mathsf{cl}( \{ G^{\phi} : G \in \ensuremath{\mathcal{F}}^\tau \} )$.  By definition, $\ensuremath{\mathcal{F}}^{\phi}$ is hereditary.
Furthermore, we note that $\ensuremath{\mathcal{F}}^{\phi}$ is an FO transduction of~$\ensuremath{\mathcal{F}}$.  Hence,
\cref{th:stable-tw-FO} implies that $\ensuremath{\mathcal{F}}^{\phi}$ is a stable family of bounded twin-width, and
therefore by \cref{thm:twin width}, $\ensuremath{\mathcal{F}}^{\phi}$ admits a constant-size adjacency sketch. Any such
sketch can be used as a $\phi$-sketch for $\ensuremath{\mathcal{F}}$, since for any two vertices $u,v$ in $G \in
\ensuremath{\mathcal{F}}^\tau$ we have $G \models \phi[u/x,v/y]$ if and only if $u$ and $v$ are adjacent in $G^{\phi}$.
\end{proof}

As a corollary we obtain an answer to an open question of
\cite{Har20}, who asked if the planar graphs admit constant-size sketches for $\mathsf{dist}(x,y) \leq k$.

\begin{corollary}
For any $k \in \ensuremath{\mathbb{N}}$ there is a constant-size sketch for planar graphs that decides $\mathsf{dist}(x,y)
\leq k$.
\end{corollary}
\begin{proof}
	The family of planar graphs has bounded twin-width \cite{BKTW20} and bounded chain number (because it is of bounded degeneracy). Hence, the result follows from \cref{thm:FO-RL} and the fact that
	the relation $\mathsf{dist}(x,y) \leq k$ is expressible in first-order logic, \eg via the following FO formula
	\[
	\delta_k(x,y) \vcentcolon= (\exists v_1, v_2, \dotsc, v_{k-1} : (E(x,v_1) \vee x=v_1) \wedge
	(E(v_1,v_2) \vee v_1=v_2) \wedge
	\dotsm \wedge (E(v_{k-1},y) \vee v_{k-1}=y)) \,.
	\]
\end{proof}

redpajama_set_name: RedPajamaArXiv