Polynomial reconstruction of the matching polynomial

Abstract: The matching polynomial of a graph is the generating function of the numbers of its matchings with respect to their cardinality. A graph polynomial is polynomial reconstructible, if its value for a graph can be determined from its values for the vertex-deleted subgraphs of the same graph. This note discusses the polynomial reconstructibility of the matching polynomial. We collect previous results, prove it for graphs with pendant edges and disprove it for some graphs.

\section{Counterexamples for arbitrary graphs}
\label{sec:counterexamples}

While it is true that the matching polynomials of graphs with an odd number of vertices or with an pendant edge are polynomial reconstructible, it does not hold for arbitrary graphs.

There are graphs which have the same polynomial deck and yet their matching polynomials are different. Although there are already counterexamples with as little as six vertices, its seems that nothing have been published before in connection with the question addressed here.

\begin{rema}
The matching polynomials $M(G, x, y)$ of arbitrary graphs are not polynomial reconstructible. The minimal counterexample for simple graphs (with respect to the number of vertices and edges) are the graphs $G_1$, $G_2$ shown in Figure~\ref{fig:counterexample}.
\end{rema}

\begin{figure}
\begin{center}
	\includegraphics{figure_counterexample}
\end{center}
\caption{Graphs $G_1$ and $G_2$, which are the minimal simple graphs creating a counterexamples for the polynomial reconstructibility of the matching polynomial $M(G, x, y)$. The decks of $G_1$ and $G_2$ consist of six graphs, each isomorphic to $G_1'$ and $G_2'$, respectively. Unlike the matchin polynomials of $G_1$ and $G_2$, the matching polynomials of $G_1'$ and $G_2'$ coincide.}
\label{fig:counterexample}
\end{figure}

The graphs creating the minimal counterexample have six vertices and there are three more pairs of such simple graphs, which are given in Figure \ref{fig:more_counterexamples}.

\begin{figure}
\begin{center}
	\includegraphics{figure_more_counterexamples}
\end{center}
\caption{The other counterexamples on six vertices for the polynomial reconstructibility of the matching polynomial $M(G, x, y)$.}
\label{fig:more_counterexamples}
\end{figure}

The question arises, whether or not there are such counterexamples consisting of graphs with an arbitrary even number of vertices. In the reminder, we give an affirmative answer to this questions.

Let $P_n$ and $C_n$ be a \emph{path} and a \emph{cycle} on $n$ vertices, respectively. For a graph $G = (V, E)$, $\overline{G}$ denotes the \emph{complement} of $G$, i.e. $\overline{G} = (V, \binom{V}{2} \setminus E)$. For two graphs $G$ and $H$, the \emph{disjoint union} of $G$ and $H$ is denoted by $G \mathrel{\mathaccent\cdot\cup} H$.

\begin{theo}
Let $k \leq 3$. The matching polynomials $M(G, x, y)$ of the graphs $C_{2k}$, $C_k \mathrel{\mathaccent\cdot\cup} C_k$ and $\overline{C_{2k}}$, $\overline{C_k \mathrel{\mathaccent\cdot\cup} C_k}$ are not polynomial reconstructible.
\end{theo}

\begin{proof}
Due to \textcite[Corollary 2.3]{godsil1981c}, the matching polynomial of a graph is determined by the matching polynomial of the complement of this graph. Furthermore, $\overline{G_{-v}} = \overline{G}_{-v}$. Therefore, it is enough to consider the graphs $C_{2k}$ and $C_k \mathrel{\mathaccent\cdot\cup} C_k$.

The matching polynomials of these two graphs do not coincide  because $C_{2k}$ has exactly two perfect matchings, while $C_k \mathrel{\mathaccent\cdot\cup} C_k$ has zero ($k$ odd) or four ($k$ even) perfect matchings.

On the other hand, their polynomial decks are identical. At first observe, that $(C_{2k})_{-v}$ is isomorphic to $P_{2k-1}$ and $(C_k \mathrel{\mathaccent\cdot\cup} C_k)_{-v}$ is isomorphic to $C_k \mathrel{\mathaccent\cdot\cup} P_{k-1}$ for every vertex $v$ of the respective graph.

It remains to show that the matching polynomials of these graphs in the deck coincide, i.e. $M(P_{2k-1}, x, y) = M(C_k \mathrel{\mathaccent\cdot\cup} P_{k-1}, x, y)$. Therefore, we make use of the well-known recurrence relation for the matching polynomial \cite[Theorem 1]{farrell1979b}:
\begin{align*}
M(G, x, y) = M(G_{-e}, x, y) + y \cdot M(G_{-u-v}, x, y),
\end{align*}
where $e = \{u, v\}$ is an edge of $G$, $G_{-e}$ is the graph with the edge $e$ deleted and $G_{-u-v}$ is the graph with the vertices of $e$ deleted.

Applying the recurrence relation to the edge connecting the $(k-2)$th and $(k-1)$th vertex of $P_{2k-1}$ (counted from either side), we obtain
\begin{align*}
M(P_{2k-1}, x, y) = M(P_{k-1} \mathrel{\mathaccent\cdot\cup} P_k, x, y) + y \cdot M(P_{k-2} \mathrel{\mathaccent\cdot\cup} P_{k-1}, x, y).
\end{align*}
Applying the recurrence relation to an edge of the cycle in $C_k \mathrel{\mathaccent\cdot\cup} P_{k-1}$, we obtain exactly the same term:
\begin{align*}
M(C_k \mathrel{\mathaccent\cdot\cup} P_{k-1}, x, y) = M(P_{k} \mathrel{\mathaccent\cdot\cup} P_{k-1}, x, y) + y \cdot M(P_{k-2} \mathrel{\mathaccent\cdot\cup} P_{k-1}, x, y).
\end{align*}

It follows, that the polynomial decks coincide, while the matching polynomials of the original graphs do not. Hence, those cannot be determined from the corresponding polynomial decks.
\end{proof}

In fact, the above construction for $k = 2$, in the case of the graphs $C_{4}$ and $C_2 \mathrel{\mathaccent\cdot\cup} C_2$, where $C_2$ is a graph on two vertices connected by two parallel edges, provide an even smaller counterexample, though the graphs are not simple.

In addition, to obtain examples on an arbitrary even number of vertices such that the graphs and their complements are connected, the construction of the graphs $G_3$ and $G_4$ as well as of their complements $G_5$ and $G_6$ can be generalized analogously.
\section{Introduction}

The famous (and still unsolved) reconstruction conjecture of \textcite{kelly1957} and \textcite{ulam1960} states that every graph $G$ with at least three vertices can be reconstructed from (the isomorphism classes of) its vertex-deleted subgraphs.

With respect to a graph polynomial $P(G)$, this question may be adapted as follows: Can $P(G)$ of a graph $G = (V, E)$ be reconstructed from the graph polynomials of the vertex deleted-subgraphs, that is from the collection $P(G_{-v})$ for $v \in V$? Here, this problem is considered for the matching polynomial of a graph, which is the generating function of the number of its matchings with respect to their cardinality.

This paper aims to prove that graphs with pendant edges are polynomial reconstructible and, on the other hand, to display some evidence that arbitrary graphs are not.

In the reminder of this section the necessary definitions and notation are given. Further, the previous results from the literature are mentioned in Section \ref{sec:known_results}. Section \ref{sec:pendant_edges} and Section \ref{sec:counterexamples} contain the result for pendant edges and the counterexamples in the general case.

Let $G = (V, E)$ be a graph. A \emph{matching} in $G$ is an edge subset $A \subseteq E$, such that no two edges have a common vertex. The \emph{matching polynomial} $M(G, x, y)$ is defined as
\begin{align}
M(G, x, y) = \sum_{\substack{A \subseteq E \\ A \text{ is matching in }G}}{x^{\md(G, A)} y^{\abs{A}}},
\end{align}
where $\md(G, A) = \abs{V} - \abs{\bigcup_{e \in A}{e}}$ is the number of vertices not included in any of the edges of $A$. A matching $A$ is a \emph{perfect matching}, if its edges include all vertices, that means if $\md(G, A) = 0$. A \emph{near-perfect matching} $A$ is a matching that includes all vertices except one, that means $\md(G, A) = 1$. For more information about matchings and the matching polynomial, see \cite{farrell1979b, gutman1977, lovasz1986}.

There are also two versions of univariate matching polynomials defined in the literature, namely the \emph{matching defect polynomial} and the \emph{matching generating polynomial} \cite[Section 8.5]{lovasz1986}. For simple graphs, the previously mentioned matching polynomials are equivalent to each other.

For a graph $G = (V, E)$ with a vertex $v \in V$, $G_{-v}$ is the graph arising from the \emph{deletion} of $v$, i.e. arising by the removal of all edges incident to $v$ and $v$ itself. The multiset of (the isomorphism classes of) the vertex-deleted subgraphs $G_{-v}$ for $v \in V$ is the \emph{deck} of $G$. The \emph{polynomial deck} $\mathcal{D}_P(G)$
with respect to a graph polynomial $P(G)$ is the multiset of $P(G_{-v})$ for $v \in V$. A graph polynomial $P(G)$ is \emph{polynomial reconstructible}, if $P(G)$ can be determined from $\mathcal{D}_P(G)$.
\section{Previous results}
\label{sec:known_results}

For results about the polynomial reconstruction of other graph polynomials, see the article by \textcite[Section 1]{bresar2005} and the references therein. For additional results, see \cites{li1995}[Section 7]{tittmann2011}[Subsection 4.7.3]{trinks2012c}.

By arguments analogous to those used in Kelly's Lemma \cite{kelly1957}, the derivative of the matching polynomials of a graph $G = (V, E)$ equals the sum of the polynomials in the corresponding polynomial deck.

\begin{prop}[Lemma 1 in \cite{farrell1987}]
Let $G = (V, E)$ be a graph. The matching polynomial $M(G, x, y)$ satisfies
\begin{align}
\frac{\delta}{\delta x} M(G, x, y) = \sum_{v \in V}{M(G_{-v}, x, y)}.
\end{align}
\end{prop}

In other words, all coefficients of the matching polynomial except the one corresponding to the number of perfect matchings can be determined from the polynomial deck and thus also from the deck:
\begin{align}
m_{i, j}(G) = \frac{1}{i} \sum_{v \in V}{m_{i, j}(G_{-v})} \qquad \forall i \leq 1,
\end{align}
where $m_{i, j}(G)$ is the coefficient of the monomial $x^i y^j$ in $M(G,x,y)$.

Consequently, the (polynomial) reconstruction of the matching polynomial reduces to the determination of the number of perfect matchings.

\begin{prop} \label{prop:polynomial_reconstruction}
The matching polynomial $M(G, x, y)$ of a graph $G$ can be determined from its polynamial deck $\mathcal{D}_M(G)$ and its number of perfect matchings. In particular, the matching polynomials $M(G, x, y)$ of graphs with an odd number of vertices are polynomial reconstructible.
\end{prop}

\textcite[Statement 6.9]{tutte1979} has shown that the number of perfect matchings of a simple graph can be determined from its deck and therefore gave an affirmative answer on the reconstruction problem for the matching polynomial.

The matching polynomial of a simple can graph also be reconstructed from the deck of edge-extracted and edge-deleted subgraphs \cite[Theorem 4 and 6]{farrell1987} and from the polynomial deck of the edge-extracted graphs \cite[Corollary 2.3]{gutman1992}. For a simple graph $G$ on $n$ vertices, the matching polynomial is reconstructible from the collection of induced subgraphs of $G$ with $\floor{\frac{n}{2}} + 1$ vertices \cite[Theorem 4.1]{godsil1981b}.
\section*{Acknowledgement}
Many thanks are due to Julian A. Allagan for his suggestions improving the presentation of this paper.

\printbibliography

\end{document}
\section{Result for simple graphs with pendant edges}
\label{sec:pendant_edges}

\begin{theo} \label{theo:forest_perfect_matching}
Let $G = (V, E)$ be a forest. $G$ has a perfect matching if and only if each vertex-deleted subgraph $G_{-v}$ for $v \in V$ has a near-perfect matching.
\end{theo}

\begin{proof}
For the first direction we assume that $G$ has a perfect matching $M$. Then each vertex-deleted subgraph $G_{-v}$ has a near-perfect matching $M' = M \setminus {e}$, where $e$ is the edge in the matching $M$ incident to $v$.

For the second direction, let $w$ be one of the vertices of degree $1$ and $u$ its neighbor. If each vertex-deleted subgraph has a near-perfect matching, say $M'$, so does $G_{-u}$. Hence, $M' \cup \{\{u, w\}\}$ is a perfect matching of $G$.
\end{proof}

Actually, this theorem can be generalized to simple graphs with a pendant edge (or equivalently a vertex of degree $1$).

\begin{theo} \label{theo:pendant_perfect_matching}
Let $G = (V, E)$ be a simple graph with a vertex of degree $1$. $G$ has a perfect matching if and only if each vertex-deleted subgraph $G_{-v}$ for $v \in V$ has a near-perfect matching.
\end{theo}

The proof is exactly the same as for the theorem above. We do not know whether or not this can be further generalized to arbitrary simple connected graphs and are also not aware of publications regarding this questions. Therefore, this problem seems to be worth further studies.

Forests have either none or one perfect matching. Because every pendant edge must be in a perfect matching (in order to cover the vertices of degree $1$) and the same holds recursively for the subforest arising by deleting all the vertices of the pendant edges. Therefore, from Proposition \ref{prop:polynomial_reconstruction} and Theorem \ref{theo:forest_perfect_matching} the polynomial reconstructibility of the matching polynomials follows.

\begin{coro}
The matching polynomials $M(G, x, y)$ of forests are polynomial reconstructible.
\end{coro}

On the other hand, arbitrary graphs with pendant edges can have more than one perfect matching. However, Theorem \ref{theo:forest_perfect_matching} can be extended to obtain the number of perfect matchings. For a graph $G = (V, E)$, the number of perfect matchings and of near-perfect machtings of $G$ is denoted by $\np(G)$ and $\nnp(G)$, respectively.

\begin{theo} \label{theo:pendant_number_perfect_matching}
Let $G = (V, E)$ be a simple graph with a pendant edge $e = \{u, w\}$ where $w$ is a vertex of degree $1$. Then we have
\begin{align}
&\np(G) = \nnp(G_{-u}) \leq \nnp(G_{-v}) \qquad \forall v \in V \text{ and particularly} \\
&\np(G) = \min{\{\nnp(G_{-v}) \mid v \in V\}}.
\end{align}
\end{theo}

\begin{proof}
For each vertex $v \in V$, each perfect matching of $G$ corresponds to a near-perfect matching of $G_{-v}$ (by removing the edge including $v$). But the converse is not necessarily true, namely there are near-perfect matching of $G_{-v}$ leaving a non-neighbor of $v$ in $G$ unmatched. Thus, we have $\np(G) \leq \nnp(G_{-v})$.

In case of the vertex $u$, each near-perfect matching $M'$ of $G_{-u}$ corresponds to a perfect matching $M$ of $G$, namely $M' \cup \{e\}$, and vice versa. Thus, we have $\np(G) = \nnp(G_{-u})$, giving the result.
\end{proof}

By applying this theorem, the number of perfect matchings of a simple graph with pendant edges can be determined from its polynomial deck and the following result is obtained as a corollary.

\begin{coro}
The matching polynomials $M(G, x, y)$ of simple graphs with a pendant edge are polynomial reconstructible.
\end{coro}


The Four Point Condition: An Elementary Tropicalization of Ptolemy's Inequality

Abstract: Ptolemy's inequality is a classic relationship between the distances among four points in Euclidean space. Another relationship between six distances is the 4-point condition, an inequality satisfied by the lengths of the six paths that join any four points of a metric (or weighted) tree. The 4-point condition also characterizes when a finite metric space can be embedded in such a tree. The curious observer might realize that these inequalities have similar forms: if one replaces addition and multiplication in Ptolemy's inequality with maximum and addition, respectively, one obtains the 4-point condition. We show that this similarity is more than a coincidence. We identify a family of Ptolemaic inequalities in CAT-spaces parametrized by a real number and show that a certain limit involving these inequalities, as the parameter goes to negative infinity, yields the 4-point condition, giving an elementary proof that the latter is the tropicalization of Ptolemy's inequality.

\section{Introduction}
Ptolemy's inequality is a classical result in Euclidean geometry that relates the six distances between 4 points in the plane. More general metric spaces where this inequality holds are called Ptolemaic and include all Euclidean spaces and $\cat(0)$ spaces. In fact, a complete Riemannian manifold is Ptolemaic if, and only if, it is $\cat(0)$ \cite{ptolemy-and-cat0}. Spherical and hyperbolic versions of this inequality also exist \cite{ptolemy-spherical, ptolemy-hyperbolic}, and we review their proof in this paper. We then show that $\cat(\kappa)$ spaces also satisfy a $\kappa$-Ptolemaic inequality, which is a rescaling of either the spherical or hyperbolic inequality depending on whether $\kappa>0$ or $\kappa<0$. Our main contribution is an interpretation of the 4-point condition
\begin{equation*}
	d_{13}+d_{24} \leq \max(d_{12}+d_{34}, d_{23}+d_{41})
\end{equation*}
that characterizes metric trees as the $(-\infty)$-Ptolemy inequality. More precisely, we show that the 4-point condition is the limit of the $\kappa$-Ptolemy inequality when $\kappa \to -\infty$, effectively characterizing metric trees as those metric spaces where the $\kappa$-Ptolemy inequality holds for all $\kappa$.

\begin{notation}
	Let $M_\kappa^n$ be the $n$-dimensional model space with constant sectional curvature $\kappa$, i.e. the $n$-sphere with radius $1/\sqrt{\kappa}$ when $\kappa>0$, $n$-dimensional Euclidean space when $\kappa=0$, or $n$-dimensional hyperbolic space with constant curvature $\kappa<0$. These spaces come equipped with a geodesic metric and have diameter $D_\kappa = \pi/\sqrt{\kappa}$ if $\kappa>0$ and $D_\kappa = \infty$ when $\kappa \leq 0$.\\
	Throughout the paper, whenever we have points $p_1,\dots,p_m$ in a single fixed metric space (either $X$ or $M_\kappa^n$), we'll denote the distance between $p_i$ and $p_j$ as $d_{ij}$. If $X$ is a $\cat$-space, we write the points of $X$ as $p_i$ and the comparison points in the model space $M_\kappa^2$ as $\overline{p}_i$. Similarly, we use $d_{ij}$ for the distances between points in $X$ and $\overline{d}_{ij}$ for the distances in the model space $M_\kappa^2$.
\end{notation}

\section{Generalizing Ptolemy's inequality}
Generalizations of Ptolemy's inequality were shown in spherical and hyperbolic geometry in \cite{ptolemy-spherical, ptolemy-hyperbolic}, and a higher-dimensional version of Ptolemy's Theorem appears in \cite{ptolemy-higher-dim}. We reproduce the arguments here to consolidate the cases of positive and negative curvature into one proof. Define
\begin{equation*}
	c_\kappa(t) =
	\begin{cases}
		\cos\left(\sqrt{\kappa} t \right), & \text{if } \kappa>0,\\
		t, & \text{if } \kappa=0,\\
		\cosh\left(\sqrt{-\kappa} t\right), & \text{if } \kappa<0,
	\end{cases}
\end{equation*}
and
\begin{equation*}
	s_\kappa(t) =
	\begin{cases}
		\sin\left(\sqrt{\kappa} t \right), & \text{if } \kappa>0,\\
		t, & \text{if } \kappa=0,\\
		\sinh\left(\sqrt{-\kappa} t\right), & \text{if } \kappa<0.
	\end{cases}
\end{equation*}
Notice that $s_\kappa(t)$ is increasing for any $t$ when $\kappa \leq 0$, and for $t \in [0,D_\kappa/2]$ when $\kappa > 0$.\\
\indent Let $p_1,\dots,p_{m} \in M_\kappa^n$. For $\kappa \neq 0$, define the matrices
\begin{align*}
	\CM_{\kappa}(p_1,\dots,p_{m}) &= \big( c_\kappa(d_{ij}) \big)_{1 \leq i,j \leq m},\\
	P_{\kappa}(p_1,\dots,p_{m}) &= \big( s_\kappa^2(d_{ij}/2) \big)_{1 \leq i,j \leq m},
\end{align*}
and their determinants
\begin{align*}
	\Delta_\kappa(p_1,\dots,p_{m}) &= \det(\CM_{\kappa}(p_1,\dots,p_{m})),\\
	\gamma_\kappa(p_1,\dots,p_{m}) &= \det(P_{\kappa}(p_1,\dots,p_{m})).
\end{align*}
The first determinant is the spherical (resp. hyperbolic) Cayley-Menger determinant when $\kappa>0$ (resp. $\kappa<0$). The following is a classic fact found at the start of Section 67 and in Theorem 106.1 of \cite{distance-geometry}. There, $\Delta_{\kappa}(p_1,\dots,p_m)$ is denoted as $\Delta_{m}(p_1,\dots,p_{m})$ when $\kappa>0$ and $\Lambda_{m}(p_1,\dots,p_{m})$ when $\kappa<0$.

\begin{theorem}\label{thm:cm_determinant}
	The determinant $\Delta_\kappa(p_1,\dots,p_{m})$ vanishes for $m \geq n+2$. If $m \leq n+1$, $\Delta_\kappa(p_1,\dots,p_{m})$ is 0 or has sign $\sgn(\kappa)^{m+1}$.
\end{theorem}

The other fact needed for the proof is the Desnanot-Jacobi identity.
\begin{theorem}\label{thm:lewis_carroll_identity}
	Let $M$ be an $n$-by-$n$ matrix. Denote by $M_{\sim i, \sim j}$ the submatrix obtained by deleting the $i$-th row and $j$-th columns of $M$. If $i<j$ and $h<k$, let $M_{\sim i,j, \sim h,k} = (M_{\sim j, \sim k})_{\sim i, \sim h}$. Then:
	\begin{equation*}
		\det(M)\det(M_{\sim 1,n, \sim 1,n}) = \det(M_{\sim 1, \sim 1}) \det(M_{\sim n, \sim n}) - \det(M_{\sim 1, \sim n}) \det(M_{\sim n, \sim 1}).
	\end{equation*}
\end{theorem}

The following is the higher dimensional generalization of Ptolemy's Theorem.
\begin{theorem}\label{thm:sign_of_ptolemys_determinant}
	Let $\kappa \neq 0$ and $p_1,\dots,p_{n+2} \in M_\kappa^{n}$. The determinant $\gamma_\kappa(p_1,\dots,p_{n+2})$ vanishes or has sign $(-1)^{n+1}$.
\end{theorem}
\begin{proof}
	Consider the matrix
	\begin{equation*}
		A =
		\left(
		\begin{array}{c|c}
			-1 & 0 \\
			\hline
			0 & \CM_\kappa(p_1,\dots,p_{n+2})
		\end{array}
		\right)
		=
		\left(
		\begin{array}{c|c}
			-1 & 0 \\
			\hline
			0 & c_\kappa(d_{ij})
		\end{array}
		\right).
	\end{equation*}
	From the half-angle formulas for trigonometric and hyperbolic functions, $c_\kappa$ and $s_\kappa$ satisfy $c_\kappa(2x)-1 = -2\sgn(\kappa) s_\kappa^2(x)$. If we subtract the first row of $A$ from the other rows and the first column from the others, we get the matrix
	\begin{equation*}
		B =
		\left(
		\begin{array}{c|c}
			-1 & 1 \\
			\hline
			1 & -2\sgn(\kappa) s_\kappa^2(d_{ij}/2).
		\end{array}
		\right),
	\end{equation*}
	with determinant $\det(B) = \det(A) = -\Delta_\kappa(p_1,\dots,p_{n+2})$. If all the first minors of $\CM_{\kappa}(p_1,\dots,p_{n+2})$ are 0, then $\CM_{\kappa}(p_1,\dots,p_{n+2})$ has rank at most $n+1$. In consequence, both $A$ and $B$ have a maximum rank of $n+2$, which means that their first minors are also 0. In particular, $\gamma_\kappa(p_1,\dots,p_{n+2}) = B_{\sim 1, \sim 1} = 0$.\\
	\indent Suppose, then, that $\CM_{\kappa}(p_1,\dots,p_{n+2})$ has a non-zero minor, and relabel the points so that $\Delta_{\kappa}(p_1,\dots,p_{n+1}) \neq 0$. By Theorem \ref{thm:lewis_carroll_identity},
	\begin{equation*}
		\det(B)\det(B_{\sim 1,n, \sim 1,n}) = \det(B_{\sim 1, \sim 1})\det(B_{\sim n, \sim n}) - \det(B_{\sim 1, \sim n})\det(B_{\sim n, \sim 1}).
	\end{equation*}
	In other words,
	\begin{align*}
		0
		&= -\Delta(p_1,\dots,p_{n+2})\det(B_{\sim 1,n, \sim 1,n})\\
		&= (-2\sgn(\kappa))^{n+2} \gamma_\kappa(p_1,\dots,p_{n+2}) (-\Delta_\kappa(p_1,\dots,p_{n+1})) - (\det(B_{\sim 1, \sim n}))^2.
	\end{align*}
	The first line is 0 because $\Delta(p_1,\dots,p_{n+2}) = 0$ by Theorem \ref{thm:cm_determinant}. Likewise, the sign of $\Delta_\kappa(p_1,\dots,p_{n+1})$ is $\sgn(\kappa)^{n+2}$, so the above equation forces
	\begin{equation*}
		\sgn(\gamma_\kappa(p_1,\dots,p_{n+2})) = -(-\sgn(\kappa))^{n+2} \sgn(\kappa)^{n+2} = (-1)^{n+1}.
	\end{equation*}
\end{proof}

The previous theorem takes a familiar form when $n=2$.
\begin{corollary}[$\kappa$-Ptolemy inequality]\label{cor:ptolemy_general_curvature}
	For any $\kappa$ and $p_1,p_2,p_3,p_4 \in M_\kappa^2$,
	\begin{equation}\label{eq:ptolemy-general}
		s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) \leq s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{23}/2)s_\kappa(d_{41}/2).
	\end{equation}
\end{corollary}
\begin{proof}
	The case of $\kappa=0$ is the usual Ptolemaic inequality in the plane. For $\kappa \neq 0$, Theorem \ref{thm:sign_of_ptolemys_determinant} gives $\gamma_\kappa(p_1,p_2,p_3,p_4) \leq 0$. In Valentine's words, ``routine but tedious computations'' \cite{ptolemy-spherical} show that $\gamma_\kappa(p_1,p_2,p_3,p_4)$ decomposes as the product $A \cdot B \cdot C \cdot D$, where
	\begin{align*}
		A &= -[s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) + s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{23}/2)s_\kappa(d_{41}/2)] \\
		B &= -\phantom{[}s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) + s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{23}/2)s_\kappa(d_{41}/2) \\
		C &= \phantom{-[}s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) - s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{23}/2)s_\kappa(d_{41}/2) \\
		D &= \phantom{-[}s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) + s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) - s_\kappa(d_{23}/2)s_\kappa(d_{41}/2).
	\end{align*}
	The sums $B+C, C+D, D+B$ are all non-negative, so no two of $B,C,D$ are negative. Since the product $B \cdot C \cdot D$ is also non-negative, we get that all three $B,C,D$ must be non-negative. In particular, $B \geq 0$ gives (\ref{eq:ptolemy-general}).
\end{proof}

\begin{example}
	Let $p_1 = (1,0,0), p_2 = (0,1,0), p_3 = (-1,0,0)$, and $p_4 = (0,-1,0)$ in $M_1^2$, the unit sphere in $\R^3$. Observe that $d_{12}=d_{23}=d_{34}=d_{41} = \pi/2$ and $d_{13}=d_{24}=\pi$. The set $X = \{p_1,p_2,p_3,p_4\}$ is a classic example of a non-Ptolemaic metric space, as
	\begin{equation*}
		d_{12}d_{34}+d_{23}d_{41} = \pi^2/2 < \pi^2 = d_{13}d_{24}.
	\end{equation*}
	However, since $X \subset M_1^2$, it satisfies the 1-Ptolemy inequality:
	\begin{equation*}
		s_1(d_{13}/2)s_1(d_{24}/2) = 1^2 \leq 2\left(\sqrt{2}/2\right)^2 = s_1(d_{12}/2)s_1(d_{34}/2) + s_1(d_{23}/2)s_1(d_{41}/2).
	\end{equation*}
\end{example}

\begin{remark}
	\cite{cm-determinant-irreducible} showed that the determinant $\gamma_\kappa(p_1,\dots,p_{n+2})$ is irreducible for $n \geq 3$.
\end{remark}

\section{CAT-spaces}
The generalization of Ptolemy's inequality to $\cat$-spaces is straightforward with the following 4-point characterization.
\begin{prop}[\cite{non-positive-curvature}, Proposition II.1.11] \label{prop:4pt_condition_CAT_spaces}
	Let $X$ be a $\cat(\kappa)$ space. For every 4-tuple $(p_1,p_2,p_3,p_4) \in X$ such that $d_{12}+d_{23}+d_{34}+d_{41} < 2D_\kappa$, there exists a 4-tuple $(\overline{p}_1,\overline{p}_2,\overline{p}_3,\overline{p}_4) \in M_\kappa^2$ such that (addition is done modulo 4):
	\begin{align*}
		d_{i,i+1} &= \overline{d}_{i,i+1} \text{ and }\\
		d_{i,i+2} &\leq \overline{d}_{i,i+2}.\\
	\end{align*}
\end{prop}

The following is a generalization of the classic argument, as seen in \cite{ptolemy-and-cat0}.
\begin{theorem}\label{thm:ptolemy_cat_spaces}
	Let $X$ be a $\cat(\kappa)$ space and $p_1,p_2,p_3,p_4 \in X$ such that $d_{12}+d_{23}+d_{34}+d_{41} < 2D_\kappa$. Then
	\begin{equation*}\label{eq:ptolemy-cat-spaces}
		s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) \leq s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{41}/2)s_\kappa(d_{23}/2).
	\end{equation*}
\end{theorem}
\begin{proof}
	With a set $\overline{p}_1, \overline{p}_2, \overline{p}_3, \overline{p}_4 \in M_\kappa^2$ as in Proposition \ref{prop:4pt_condition_CAT_spaces}, Corollary \ref{cor:ptolemy_general_curvature} gives
	\begin{align*}
		s_\kappa(d_{13}/2)s_\kappa(d_{24}/2)
		&\leq s_\kappa(\overline{d}_{13}/2) s_\kappa(\overline{d}_{24}/2)\\
		&\leq s_\kappa(\overline{d}_{12}/2) s_\kappa(\overline{d}_{34}/2) + s_\kappa(\overline{d}_{23}/2) s_\kappa(\overline{d}_{41}/2)\\
		&= s_\kappa(d_{12}/2) s_\kappa(d_{34}/2) + s_\kappa(d_{23}/2) s_\kappa(d_{41}/2).
	\end{align*}
\end{proof}

\begin{example}\label{ex:diameter-example}
	Corollary \ref{cor:ptolemy_general_curvature} is stronger than Theorem \ref{thm:ptolemy_cat_spaces} applied to $M_\kappa^2$ because the former holds without the restriction $d_{12}+d_{23}+d_{34}+d_{41} < 2D_\kappa$. However, this condition is necessary in the latter, as shown by the following example.\\
	\indent Let $G$ be the metric graph formed by a circle $C$ of radius 1 with three edges $e_1,e_2,e_3$ of length $\pi$ attached at the points $p_1,p_2,p_3 \in C$ (see Figure \ref{fig:perimeter_condition}), where $d_G(p_i,p_j) = 2\pi/3$ for $i \neq j$. Since the cycle $C$ has length $2\pi$, $G \in \cat(1)$ \cite[Example II.1.15]{non-positive-curvature}. Let $x_i \in e_i$ such that $d_G(x_i,p_i) = \pi$, and set $x_4=p_3$. Let $d_{ij} = d_G(x_i,x_j)$. We have
	\begin{equation*}
		d_{12}+d_{23}+d_{34}+d_{41} = 8\pi > 2D_1,
	\end{equation*}
	and
	\begin{align*}
		s_1(d_{13}/2) s_1(d_{24}/2)
		&= -\frac{\sqrt{3}}{2} \cdot \frac{1}{2}\\
		&> -\frac{\sqrt{3}}{2} \cdot 1 + \left(-\frac{\sqrt{3}}{2}\right) \cdot \frac{1}{2}\\
		&= s_1(d_{12}/2) s_1(d_{34}/2) + s_1(d_{23}/2) s_1(d_{41}/2).
	\end{align*}

	\begin{figure}
		\centering
		\input{figures/CAT0-diameter-example}
		\caption{An example of a $\cat(1)$ space $G$ and a subset $x_1,x_2,x_3,x_4$ that show that the restriction $d_{12}+d_{23}+d_{34}+d_{41} < 2D_\kappa$ is necessary in Theorem \ref{thm:ptolemy_cat_spaces}.}
		\label{fig:perimeter_condition}
	\end{figure}
\end{example}

\begin{question}{1}
	The fact that $d_{12}+d_{23}+d_{34}+d_{41}=8\pi$ is much larger than $2D_1=2\pi$ in Example \ref{ex:diameter-example} begs the question of whether the condition $d_{12}+d_{23}+d_{34}+d_{41} < 2D_1$ in Theorem \ref{thm:ptolemy_cat_spaces} is tight or even if it is necessary. We don't have an answer at this point.
\end{question}

\begin{question}{2}
	Analogously to the hyperbolicity of a metric space, we can define
	\begin{equation*}
		P_\kappa(X) = \sup\left[ s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) - \big(s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{41}/2)s_\kappa(d_{23}/2)\big) \right],
	\end{equation*}
	where $d_{ij}=d_X(p_i,p_j)$ and the supremum is taken over all $\{p_1,p_2,p_3,p_4\} \subset X$. What properties does this constant have? In particular, is it stable under the Gromov-Hausdorff distance?
\end{question}

\section{The limiting case}
\indent Metric trees are $\cat(\kappa)$ for any $\kappa \in \R$ \cite{non-positive-curvature}, so they satisfy the $\kappa$-Ptolemy inequality for any $\kappa$ by Theorem \ref{thm:ptolemy_cat_spaces}. Now we ask the converse: what can we say about a space $X$ that satisfies the $\kappa$-Ptolemy inequality for all $\kappa$? To answer this, we calculate a certain limit as $\kappa \to -\infty$. For that, recall that $\arcsinh(x) = \ln(x+\sqrt{x^2+1})$ and observe that $\lim_{x \to \infty} \frac{\arcsinh(x)}{\ln(x)} = 1$. If the limit of either the numerator or the denominator exists, then both limits exist and are equal.\\
\indent Let $a,b,c,d \geq 0$ and suppose $c+d \leq a+b$. Then:
\begin{align*}
	\lim_{\kappa \to -\infty} &\textstyle \frac{2}{\sqrt{-\kappa}}\textstyle \arcsinh\left[\sinh\left(\frac{\sqrt{-\kappa}}{2}a\right) \cdot \sinh\left(\frac{\sqrt{-\kappa}}{2}b\right) + \sinh\left(\frac{\sqrt{-\kappa}}{2}c\right) \cdot \sinh\left(\frac{\sqrt{-\kappa}}{2}d\right)\right] \\

	&=\lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\left[
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}a\right)-\exp\left(-\frac{\sqrt{-\kappa}}{2}a\right)}{2} \cdot
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}b\right)-\exp\left(-\frac{\sqrt{-\kappa}}{2}b\right)}{2}\right.\\
	&\indent \phantom{\lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\big[\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right) \big(}+\left.\textstyle
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}c\right)-\exp\left(-\frac{\sqrt{-\kappa}}{2}c\right)}{2} \cdot
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}d\right)-\exp\left(-\frac{\sqrt{-\kappa}}{2}d\right)}{2}
	\right]\\
	%
	&= \lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\left[
	\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right) \left(\frac{1-\exp(-\sqrt{-\kappa}a)}{2} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}b)}{2}\right.\right.\\
	&\indent \phantom{\lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\big[\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right) \big(}+\left.\left.\textstyle
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}(c+d)\right)}{\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right)} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}c)}{2} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}d)}{2}
	\right)\right] \\
	%
	&= \lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\left[
	\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right)\right]\\
	& \indent + \lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \ln\left[\frac{1-\exp(-\sqrt{-\kappa}a)}{2} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}b)}{2} +
	\frac{\exp\left(\frac{\sqrt{-\kappa}}{2}(c+d)\right)}{\exp\left(\frac{\sqrt{-\kappa}}{2}(a+b)\right)} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}c)}{2} \cdot
	\frac{1-\exp(-\sqrt{-\kappa}d)}{2}
	\right] \\
	&= a+b.
\end{align*}
Since $c+d < a+b$, we have:
\begin{align*}
	\max(a+b, &\ c+d)\\&= \lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \arcsinh\left[ \sinh(\frac{\sqrt{-\kappa}}{2}a) \cdot \sinh(\frac{\sqrt{-\kappa}}{2}b) + \sinh(\frac{\sqrt{-\kappa}}{2}c) \cdot \sinh(\frac{\sqrt{-\kappa}}{2}d)\right].
	\intertext{In particular, if $c=d=0$,}
	a+b &= \lim_{\kappa \to -\infty}\textstyle \frac{2}{\sqrt{-\kappa}} \arcsinh\left[ \sinh(\frac{\sqrt{-\kappa}}{2}a) \cdot \sinh(\frac{\sqrt{-\kappa}}{2}b)\right].
\end{align*}

As a result, if the inequality
$
s_\kappa(d_{13}/2)s_\kappa(d_{24}/2) \leq s_\kappa(d_{12}/2)s_\kappa(d_{34}/2) + s_\kappa(d_{41}/2)s_\kappa(d_{23}/2)
$
is satisfied for all $\kappa<0$, when we take $\frac{2}{\sqrt{-\kappa}}\arcsinh(\cdot)$, the limit above gives
\begin{equation*}
	d_{13}+d_{24} \leq \max(d_{12}+d_{34}, d_{14}+d_{23}).
\end{equation*}

In other words, if $X$ satisfies the $\kappa$-Ptolemy inequality for all $\kappa$, then it also satisfies the 4-point condition, giving the following characterization of metric trees.

\begin{theorem}
	Given a metric space $(X,d_X)$, the following are equivalent:
	\begin{enumerate}
		\item $X$ can be isometrically embedded in a metric tree.
		\item Every subset $\{x_1,x_2,x_3,x_4\} \subset X$ satisfies the 4-point condition.
		\item Every subset $\{x_1,x_2,x_3,x_4\} \subset X$ satisfies the $\kappa$-Ptolemy inequality for all $\kappa$ such that $d_{12}+d_{23}+d_{34}+d_{41} < 2D_\kappa$.
	\end{enumerate}
\end{theorem}


Almost tiling of the Boolean lattice with copies of a poset

Abstract: Let $P$ be a partially ordered set. If the Boolean lattice $(2^{[n]},\subset)$ can be partitioned into copies of $P$ for some positive integer $n$, then $P$ must satisfy the following two trivial conditions:(1) the size of $P$ is a power of $2$,(2) $P$ has a unique maximal and minimal element.Resolving a conjecture of Lonc, it was shown by Gruslys, Leader and Tomon that these conditions are sufficient as well. In this paper, we show that if $P$ only satisfies condition (2), we can still almost partition $2^{[n]}$ into copies of $P$. We prove that if $P$ has a unique maximal and minimal element, then there exists a constant $c=c(P)$ such that all but at most $c$ elements of $2^{[n]}$ can be covered by disjoint copies of $P$.

\section{Introduction}

The \emph{Boolean lattice} $(2^{[n]},\subset)$ is the power set of $[n]=\{1,...,n\}$ ordered by inclusion. If $P$ and $Q$ are partially ordered sets (posets), a subset $P'\subset Q$ is a \emph{copy} of $P$ if the subposet of $Q$ induced on $P'$ is isomorphic to $P$. A \emph{chain} is a copy of a totally ordered set, and an \emph{antichain} is a copy of a totally unordered set.

It is an easy exercise to show that every poset $P$ has a copy in $2^{[n]}$ for $n$ sufficiently large. Moreover, if $P$ has a unique maximal and minimal element, then every element of $2^{[n]}$ is contained in some copy of $P$. Therefore, it is natural to ask whether it is possible to partition $2^{[n]}$   into copies of $P$.

The case when $P$ is a chain of size $2^{k}$ was conjectured by Sands \cite{sands}. A slightly more general conjecture was proposed by Griggs \cite{griggs}: if $h$ is a positive integer and $n$ is sufficiently large, then  $2^{[n]}$ can be partitioned into chains such that at most one of these chains have size different from $h$. This conjecture was confirmed by Lonc \cite{lonc}. The author of this paper \cite{me} also established the order of the minimal $n$ for which such a partition exists.

\begin{theorem}\label{chainpartition}
	(\cite{me}) Let $h$ be a positive integer. If $n=\Omega(h^{2})$, the Boolean lattice $2^{[n]}$ can be partitioned into chains $C_{1},...,C_{r}$ such that $2h>|C_{1}|\geq h$ and $|C_{2}|=...=|C_{r}|=h$.
\end{theorem}

We note that Theorem \ref{chainpartition} is stated in \cite{me} as Theorem 5.2 without the additional condition that $|C_{1}|\geq h$. However, the proof of Theorem 5.2 presented in \cite{me} actually gives this insignificantly stronger result, which we shall exploit in this paper.

Lonc \cite{lonc} also proposed two conjectures concerning the cases when $P$ is not necessarily a chain. First, he conjectured that if $P$ has a unique maximal and minimal element and size $2^{k}$, then $2^{[n]}$ can be partitioned into copies of $P$ for $n$ sufficiently large. It is easy to see that these conditions on $P$ are necessary, and it was proved by Gruslys, Leader and the author of this paper \cite{posettiling} that these conditions are sufficient as well.

\begin{theorem}(\cite{posettiling})\label{poset}
	Let $P$ a poset with a unique maximal and minimal element and $|P|=2^{k}$, $k\in \mathbb{N}$. If $n$ is sufficiently large, the Boolean lattice $2^{[n]}$ can be partitioned into copies of $P$.
\end{theorem}

The second conjecture of Lonc targets posets which might not satisfy the conditions stated in Theorem \ref{poset}. In this case, it seems likely that we can still cover almost every element of $2^{[n]}$ with disjoint copies of $P$.

\begin{conjecture}(\cite{lonc})\label{loncconjecture}
	Let $P$ be a poset. If $n$ is sufficiently large and $|P|$ divides $2^{n}-2$, then $2^{[n]}\setminus \{\emptyset,[n]\}$ can be partitioned into copies of $P$.
\end{conjecture}

In \cite{posettiling}, a slightly weaker conjecture is proposed.

\begin{conjecture}(\cite{posettiling})\label{mainconjecture}
	Let $P$ be a poset. There exists a constant $c=c(P)$ such that for every positive integer $n$, there exists $S\subset 2^{[n]}$ such that $2^{[n]}\setminus S$ can be partitioned into copies of $P$ and $|S|\leq c$.
\end{conjecture}

In other words, Conjecture \ref{mainconjecture} asks if we can cover all but a constant number of the elements of $2^{[n]}$ with disjoint copies of $P$. Note that Conjecture \ref{loncconjecture} implies Conjecture \ref{mainconjecture} in the case $|P|$ is not divisible by $4$.

The main result of this manuscript is a proof of Conjecture \ref{mainconjecture} in the case $P$ has a unique maximal and minimal element. We believe that the method of proof presented here might lead to the proof of this conjecture in its full generality. We prove the following theorem.

\begin{customthm}{A}\label{mainthm}
	Let $P$ be a poset with a uniqe maximal and minimal element. There exists a constant $c=c(P)$ such that the following holds. Let $n$ be a positive integer, then there exists $S\subset 2^{[n]}$ such that $2^{[n]}\setminus S$ can be partitioned into copies of $P$, and $|S|\leq c$.
\end{customthm}

This paper is organized as follows. In Section \ref{prelim}, we introduce the main definitions and notation used throughout the paper, and outline the proof of Theorem \ref{mainthm}. In Section \ref{grid}, we prove a modification of Theorem \ref{poset}, where $2^{[n]}$ is replaced with an appropriately sized grid. In Section \ref{grid2}, we show that Conjecture \ref{mainconjecture} holds when $P$ is a grid. In Section \ref{finalproof}, we prove Theorem \ref{mainthm} and conclude with some discussion.

\section{Preliminaries}\label{prelim}

\subsection{Cartesian product of posets}
The proof of Theorem \ref{mainthm} relies heavily on the product structure of $2^{[n]}$. Let us define the \emph{cartesian product} of posets.
If $P_{1},...,P_{k}$ are  posets with partial orderings $\preceq_{1},...,\preceq_{k}$ respectively, the cartesian product $P_{1}\times...\times P_{k}$ is also a poset with partial ordering $\preceq$ such that $(p_{1},...,p_{k})\preceq(p_{1}',...,p_{k}')$ if $p_{i}\preceq_{i} p_{i}'$ for $i=1,...,k$. Also, $P^{k}=P\times...\times P$ is the $k$-th \emph{cartesian power} of $P$, where the cartesian product contains $k$ terms.

For every positive integer $m$, we shall view $[m]$ as a poset with the natural total ordering. For positive integers $a_{1},...,a_{d}$, the cartesian product $[a_{1}]\times...\times [a_{d}]$ is called a \emph{$d$-dimensional grid}; $2$-dimensional grids may be referred to as \emph{rectangles}. That is, if $\preceq$ is the partial ordering on $[a_{1}]\times...\times [a_{d}]$, then $\preceq$ is defined such that if $(x_{1},...,x_{d}),(y_{1},...,y_{d})\in [a_{1}]\times...\times [a_{d}]$, then $(x_{1},...,x_{d})\leq (y_{1},...,y_{d})$ iff $x_{i}\leq y_{i}$ for $i=1,...,d$. Note that the Boolean lattice $2^{[n]}$ is isomorphic to the $n$-dimensional grid $[2]^{n}$ and we might occasionally switch between the two notation without further comments.

\subsection{Outline of the proof}

The framework used in \cite{posettiling} for the proof of Theorem \ref{poset} can be easily modified to show that if $P$ has a unique maximal and minimal element, then Theorem \ref{poset} holds if $2^{[n]}$ is replaced with some appropriately sized grid. We prove the following theorem in Section \ref{grid}.

\begin{theorem}\label{gridpartitionthm}
	Let $P$ be a poset with a unique maximal and minimal element. If $d$ is sufficiently large, then $[2|P|]^{d}$ can be partitioned into copies of $P$.
\end{theorem}

Now our task is reduced to showing that Theorem \ref{mainthm} holds when $P$ is a grid. The new ingredient in our paper is the following result, which shall be proved in Section \ref{grid2}.

\begin{theorem}\label{gridthm}
	Let $P$ be a $d$-dimensional grid. If $n=\Omega(d|P|^{4})$, then there exists $S\subset 2^{[n]}$ such that $2^{[n]}\setminus S$ can be partitioned into copies of $P$ and $|S|\leq (24|P|^{2})^{d}$.
\end{theorem}

These two theorems combined immediately yield our main result, see Section \ref{finalproof}.

\section{Partitioning the grid}\label{grid}

In this section, we prove Theorem \ref{gridpartitionthm}. The proof of this theorem follows the same ideas as the proof of Theorem \ref{poset} in \cite{posettiling}, with slight modifications. We shall reuse some of the results of \cite{posettiling} in order to shorten and simplify this manuscript.

 \subsection{Weak partitions}

 Let $S$ be a finite set and let $\mathcal{F}$ be a family of subsets of $S$. We call a function $w:\mathcal{F}\rightarrow \mathbb{N}$ a \emph{weight function}. If $x\in S$, the \emph{weight of $x$} is the total weight of the sets in $\mathcal{F}$ containing $x$.

 Let $t$ be a positive integer. The family $\mathcal{F}$ \emph{contains a $t$-partition}, if there exists a weight function on $\mathcal{F}$ such that the weight of each $x\in S$ is $t$. Similarly, $\mathcal{F}$ \emph{contains a $(1\mod t)$-partition}, if there exists a weight function on $\mathcal{F}$ such that the weight of each $x\in S$ equals to $1\mod t$.

 If $\mathcal{F}$ contains a $1$-partition, then the family of sets having weight $1$ in $\mathcal{F}$ is a partition of $S$ in the usual sense. Also, if $\mathcal{F}$ has a $1$-partition, it trivially has a $t$-partition and a ${(1\mod t)}$-partition as well for every positive integer $t$.

 A remarkable result of Gruslys, Leader and Tan \cite{tiling} is that the existence of a $t$-partition and a ${(1\mod t)}$-partition also implies the existence of a $1$-partition of $S^{n}$, for some sufficiently large $n$, into sets that "look like" elements of $\mathcal{F}$. Let us define this precisely.

 For a positive integer $n$, define $\mathcal{F}(n)$ to be the family of all subsets of $S^{n}$ of the form $$\{s_{1}\}\times...\times \{s_{i-1}\}\times F\times \{s_{i+1}\}\times...\times \{s_{n}\},$$
 where $i\in [n]$, $s_{1},...,s_{i-1},s_{i+1},...,s_{n}\in S$ and $F\in \mathcal{F}$. The following result played a key role in both \cite{tiling,posettiling}, and shall play an important role in this paper as well. It was stated explicitly in \cite{posettiling} as Theorem 5.

 \begin{theorem}(\cite{posettiling})\label{Spartition}
 	Let $S$ be a finite set, $\mathcal{F}$ be a family of subsets of $S$ and $t\in \mathbb{N}$. Suppose that $\mathcal{F}$ contains a $t$-partition and a $(1\mod t)$-partition. Then for $n$ sufficiently large, $S^{n}$ can be partitioned into elements of $\mathcal{F}(n)$.
 \end{theorem}

 Let us say a few remarks about this theorem. Note that  if $S$ is endowed with a partial ordering and $\mathcal{F}$ is the family of all copies of some poset $P$, then $\mathcal{F}(n)$ is also a family of copies of $P$ in $S^{n}$. (However, it is not true that every copy of $P$ in $S^{n}$ is an element of $\mathcal{F}(n)$.) Also, at first glance it might not be clear why is it easier to find a $t$-partition or a $(1\mod t)$-partition than a $1$-partition, but as we shall see in the next section, this problem is substantially simpler.

 \subsection{$t$ and $(1\mod t)$-partitions}

 In order to prove Theorem \ref{gridpartitionthm}, we only need to show that the family of copies of $P$ in $[2|P|]^{m}$ contains a $t$-partition and a $(1\mod t)$-partition for some $m,t$ positive integers.

 \begin{theorem}\label{tpartition}
 	Let $P$ be a poset with a unique maximal and minimal element. Then there exist positive integers $m$ and $t$ such that the family of copies of $P$ in $[2|P|]^{m}$ contains a $t$-partition.
 \end{theorem}

 \begin{proof}
 	In \cite{posettiling}, Lemma 3 states that there exist $m$ and $t$ such that the family of copies of $P$ in $[2]^{m}$ contains a $t$-partition. However, $[2|P|]^{m}$ can be trivially partitioned into copies of $[2]^{m}$: for $(i_{1},...,i_{m})\in [|P|]^{m}$, let
 	$$B_{i_{1},...,i_{m}}=\{(2i_{1}+\epsilon_{1}-2,...,2i_{m}+\epsilon_{m}-2):(\epsilon_{1},...,\epsilon_{m})\in [2]^{m}\}.$$
 	Then $B_{i_{1},...,i_{m}}$ is isomorphic to $[2]^{m}$ and the family of these sets form a partition of $[2|P|]^{m}$.
 \end{proof}

 \begin{theorem}\label{modtpartition}
 	Let $P$ be a poset with a unique maximal and minimal element and let $t$ be a positive integer. Then there exists a positive integer $m$ such that the family of copies of $P$ in $[2|P|]^{m}$ contains a $(1\mod t)$-partition.
 \end{theorem}

 \begin{proof}
 	If $|P|=1$, the proof is trivial, so we can suppose that $|P|\geq 2$.

 	Let $d$ be a positive integer such that $2^{[d]}$ contains a copy of $P$. We show that $m=2d-1$ suffices. For simplicity, write $Q=[2|P|]^{m}$ and let $\preceq$ be the partial ordering on $Q$.

 	Let $\mathcal{F}$ be the family of copies of $P$ in $Q$. Also, for a subset $A\subset Q$, let $I_{A}:Q\rightarrow \mathbb{N}$ be the indicator function of $A$.

 	 Say that a function  $f:Q\rightarrow \mathbb{Z}$ is \emph{realizable} if there exists a weight function $w:\mathcal{F}\rightarrow \mathbb{N}$ such that $$f(x)\equiv\sum_{\substack{F\in\mathcal{F}\\x\in F}} w(F)\mod t$$
 	for all $x\in Q$.  Note that if $f$ and $g$ are realizable, then both $f+g$ and $f-g$ are realizable, as $f-g\equiv f+(t-1)g\mod t$.

 	Our task is to show that $I_{Q}$ is realizable.

 	Let $\mathbf{a}$ be the element of $Q$ whose every coordinate is $2$.
 	\begin{claim}\label{twoelementsclaim}
 	 For every $\mathbf{x}\in Q$, the function $I_{\{\mathbf{x}\}}-I_{\{\mathbf{a}\}}$ is realizable.
 	\end{claim}

     \begin{proof}

 Consider two cases according to the number of $1$ coordinates of $\mathbf{x}$.

 	Case 1: The number of coordinates of $\mathbf{x}$ equal to $1$ is at most $d-1$. Let $J$ be a set of $d$ indices $j\in [m]$ such that $\mathbf{x}(j)\geq 2$. Let
 	$$R=\{(a_{1},...,a_{m})\in [2]^{m}: a_{j}=1\mbox{, if }j\not\in J\}.$$
 	Then $R$ is isomorphic to $2^{[d]}$, so it contains a copy of $P$. Let such a copy be $A\subset R$. If $\mathbf{b}$ is the maximal element of $A$, then $\mathbf{b}\preceq \mathbf{x}$ and $\mathbf{b}\preceq \mathbf{a}$. Hence, $A_{1}=(A\setminus\{\mathbf{b}\})\cup\{\mathbf{x}\}$ and $A_{2}=(A\setminus\{\mathbf{b}\})\cup\{\mathbf{a}\}$ are both copies of $P$, which implies that the function
 	$$I_{A_{1}}-I_{A_{2}}=I_{\{\mathbf{x}\}}-I_{\{\mathbf{a}\}}$$
 	is realizable.

 	Case 2: The number of coordinates of $\mathbf{x}$ equal to $1$ is at least $d$. In a similar way as in the previous case, we show that $I_{\{\mathbf{x}\}}-I_{\{\mathbf{a}\}}$ is realizable.  Let $J$ be a set of $d$ indices $j\in [m]$ such that $\mathbf{x}(j)= 1$. Let
 	$$R=\{(a_{1},...,a_{m})\in \{2|P|-1,2|P|\}^{m}: a_{j}=2|P|\mbox{, if }j\not\in J\}.$$
 	Then $R$ is isomorphic to $2^{[d]}$, so it contains a copy of $P$. Let such a copy be $A\subset R$. If $\mathbf{c}$ is the minimal element of $A$, then $\mathbf{x}\preceq \mathbf{c}$ and $\mathbf{a}\preceq \mathbf{c}$. Hence, $A_{1}=(A\setminus\{\mathbf{c}\})\cup\{\mathbf{x}\}$ and $A_{2}=(A\setminus\{\mathbf{c}\})\cup\{\mathbf{a}\}$ are both copies of $P$, which implies that the function
 	$$I_{A_{1}}-I_{A_{2}}=I_{\{\mathbf{x}\}}-I_{\{\mathbf{a}\}}$$
 	is realizable.
 \end{proof}

  The previous claim immediately yields the following claim.

  \begin{claim}\label{sum0claim}
  	Let $f:Q\rightarrow \mathbb{Z}$ be a function such that
  	$$\sum_{\mathbf{x}\in Q}f(\mathbf{x})\equiv 0\mod t.$$
  	Then $f$ is realizable.
  \end{claim}

\begin{proof}
    Define the function $g:Q\rightarrow \mathbb{Z}$ such that
	$$g=\sum_{\mathbf{x}\in Q}f(\mathbf{x})(I_{\{\mathbf{x}\}}-I_{\{\mathbf{a}\}}).$$
	Clearly, $g$ is realizable as every term in the sum is realizable by Claim \ref{twoelementsclaim}. Also, $f(\mathbf{x})=g(\mathbf{x})$ for all $\mathbf{x}\neq \mathbf{a}$. But $g$ satisfies the equality $\sum_{\mathbf{x}\in Q}g(\mathbf{x})\equiv 0\mod t$ as well, so we must have $f(\mathbf{a})\equiv g(\mathbf{a})\mod t$. Hence, $f\equiv g\mod t$, which gives that $f$ is realizable.
\end{proof}

Now let $A\subset Q$ be a copy of $P$ and $s=t|Q|/|P|$. Note that $s$ is an integer. The function $sI_{A}$ is realizable and $f=I_{Q}-sI_{A}$ satisfies the equality $\sum_{\mathbf{x}\in Q}f(\mathbf{x})\equiv 0\mod t,$ so $f$ is also realizable by Claim \ref{sum0claim}. But then $I_{Q}=f+sI_{A}$ is realizable as well.
 \end{proof}

  Let us remark that if the family of copies of $P$ in $[2|P|]^{m_{0}}$ contains a $t$-partition or a $(1\mod t)$-partition, then the family of copies of $P$ in $[2|P|]^{m}$ also contains a $t$-partition or $(1\mod t)$-partition, respectively, for $m>m_{0}$, as  $[2|P|]^{m}$ can be trivially partitioned into copies of $[2|P|]^{m_{0}}$.

\subsection{Proof of Theorem \ref{gridpartitionthm}}

Now everything is set to prove that if $P$ has a unique maximal and minimal element, then $[2|P|]^{d}$ can be partitioned into copies of $P$ for $d$ sufficiently large.

\begin{proof}[Proof of Theorem \ref{gridpartitionthm}]
	By Theorem \ref{tpartition}, there exist positive integers $t$ and $m_{1}$ such that the family of copies of $P$ in $[2|P|]^{m_{1}}$ contains a $t$-partition. Also, by Theorem \ref{modtpartition}, there exists a positive integer $m_{2}$ such that the family of copies of $P$ in $[2|P|]^{m_{2}}$ contains a $(1\mod t)$-partition. Let $m=\max\{m_{1},m_{2}\}$, then the family of copies of $P$ in $[2|P|]^{m}$ contains both a $t$ and a $(1\mod t)$-partition. Hence, by Theorem \ref{Spartition}, there exists a positive integer $n$ such that $([2|P|]^{m})^{n}$ can be partitioned into copies of $P$. But then $d\geq mn$ suffices as $([2|P|]^{m})^{n}\cong [2|P|]^{mn}$.

\end{proof}

\section{Almost partitioning into grids}\label{grid2}

In this section, we prove Theorem \ref{gridthm}. Let us briefly outline our strategy for the proof of this theorem. Let $P$ be a $d$-dimensional grid. First, we use Theorem \ref{chainpartition} to partition $2^{[m]}$ (for sufficiently large $m$) into chains $C_{1},...,C_{r}$ such that all these chains are large (but still constant sized) and at most one of them, $C_{1}$ might have size not divisible by $|P|$. This chain partition induces a partition of $2^{[dm]}\simeq (2^{[m]})^{d}$ into the family of grids $D_{i_{1},...,i_{d}}\simeq C_{i_{1}}\times...\times C_{i_{d}}$, where $(i_{1},...,i_{d})\in [r]^{d}$. We conclude by showing that unless $i_{1}=...=i_{d}=1$, the grid $D_{i_{1},...,i_{d}}$ can be partitioned into copies of $P$, so the subset of elements which are uncovered by disjoint copies of $P$ is $D_{1,...,1}$, a set of constant size.

Now let us first show that as long as one side of a $d$-dimensional grid $G$ is divisible by $2|P|$, and all the sides of $G$ are large, we can partition $G$ into copies of $P$.

\begin{lemma}\label{gridintogrid}
	Let $P$ be a $d$-dimensional grid and let $c_{1},...,c_{d-1}$ be positive integers satisfying $c_{i}\geq 12|P|^{2}$ for $i\in [d-1]$. Then the $d$-dimensional grid $[2|P|]\times [c_{1}]\times...\times[c_{d-1}]$ can be partitioned into copies of $P$.
\end{lemma}

\begin{proof}
	Let us first prove our theorem for $d=2$, the general statement follows by induction on $d$.
	\begin{claim}\label{rectangle}
		Let $a,b,c$ be positive integers such that $c\geq a^{2}b+2a$ and $a$ is even. Then $[ab]\times [c]$ can be partitioned into copies of $[a]\times [b]$.
	\end{claim}

\begin{proof}
	Write $c=ad+r$, where $d,r$ are positive integers and $0\leq r<a$. If $r=0$, we can trivially partition $[ab]\times [c]$ into copies of $[a]\times [b]$. So let us assume that $r\geq 1$, and let
	$$\epsilon= \begin{cases} 1 &\mbox{if } r=1 \\
		2 &\mbox{if } r\geq 2. \end{cases}$$

	  By the condition $c\geq a^{2}b+2a$, we have $d\geq br+2$. Let $R=[a]\times [b]$ and denote by $\preceq$ the partial ordering on $[ab]\times [c]$.

	 Consider the following two collections of copies of $R$ in $[ab]\times [c]$. For $(i,j)\in [a/2]\times [d]$, let
	 $$A_{i,j}=\{(b(i-1)+x,r+a(j-1)+y:(x,y)\in [b]\times [a]\}$$
	 and
	 $$B_{i,j}=\{(ab/2+b(i-1)+x,a(j-1)+y:(x,y)\in [b]\times [a]\},$$
	 see Figure \ref{image}.
	 Clearly, the sets $A_{i,j}$ and $B_{i,j}$ are copies of $R$ and pairwise disjoint. Also, their union covers all elements of $[ab]\times [c]$, except for the elements of the sets $S=[ab/2]\times [r]$ and $T=[ab/2+1,ab]\times [ad+1,c]$.

	 Now we shall modify some of the sets $A_{i,j}$ by  switching their maximal elements with an element of $T$, and we shall switch the minimal elements of some of the sets $B_{i,j}$ with an element of $S$. We shall execute these switches in a way that the freed up elements of $[ab]\times [c]$ can be easily partitioned into copies of $R$.

	 For $(i,j)\in [a/2]\times [br]$, let $x_{i,j}=(bi,r+aj)$, which is the maximal element of $A_{i,j}$, and let $y_{i,j}=(ab/2+b(i-1)+1,a(j+\epsilon-1)+1)$, which is the minimal element of $B_{i,j+\epsilon}$. We remark that we used the inequality $j+2\leq br+2\leq d$ to guarantee that $A_{i,j}$ and $B_{i,j+\epsilon}$ exist. Let $\phi$ be any bijection between $[a/2]\times [br]$ and $T$, and let $\varphi$ be a bijection between $[a/2]\times [br]$ and $S$.

	 For $(i,j)\in [a/2]\times [br]$, let
	 $$A'_{i,j}=(A_{i,j}\setminus \{x_{i,j}\})\cup\{\phi(i,j)\},$$
	 $$B'_{i,j+\epsilon}=(B_{i,j+\epsilon}\setminus \{y_{i,j}\})\cup\{\varphi(i,j)\}.$$
	 Also, for $(i,j)\in [a/2]\times [br+1,d]$, let $A'_{i,j}=A_{i,j}$, and for $(i,j)\in [a/2]\times([\epsilon]\cup [br+\epsilon+1,d])$, let $B'_{i,j}=B_{i,j}$.
	 For $(i,j)\in [a/2]\times [br]$, the set $A_{i,j}$ is contained in $[ab/2]\times [abr+r]$. As $abr+r<ad+1$, we have that every element of $T$ is $\preceq$-larger than every element of $A_{i,j}$. Hence, $A'_{i,j}$ is also a copy of $R$, remembering that $x_{i,j}$ is the maximal element of $A_{i,j}$. Similarly, $B'_{i,j+\epsilon}$ is also a copy of $R$, as $B'_{i,j+\epsilon}$ is equal to $B_{i,j}$ with its minimal element replaced with a $\preceq$-smaller element.
	 For $(i,j)\in [a/2]\times [d]$, the sets $A'_{i,j}$ and $B'_{i,j}$ are disjoint copies of $R$ and their union covers all elements of $[ab]\times [c]$, except for the set $$X=\{x_{i,j}:(i,j)\in [a/2]\times [br]\}\cup\{y_{i,j}:(i,j)\in [a/2]\times [br]\}.$$

     But $X$ can be easily partitioned into copies of $R$. For $k\in [r]$, let

	 $$C_{k}=\{x_{i,b(k-1)+j}:(i,j)\in [a/2]\times [b]\}\cup \{y_{i,b(k-1)+j}:(i,j)\in [a/2]\times [b]\}.$$
	 Clearly, the sets $C_{k}$ for $k=1,..,r$ partition $X$, so the only thing left is to show that $C_{k}$ is a copy of $R$.

	  We show that the function $\pi:C_{k}\rightarrow R$ defined by $\pi(x_{i,b(k-1)+j})=(i,j)$ and $\pi(y_{i,b(k-1)+j})=(i+a/2,b)$ is an isomorphism.
	  As $\pi$ defines an isomorphism between $\{x_{i,b(k-1)+j}:(i,j)\in [a/2]\times [b]\}$ and $[a/2]\times [b]$, and it defines an isomorphism between $\{y_{i,b(k-1)+j}:(i,j)\in [a/2]\times [b]\}$ and $[a/2+1]\times [b]$, it is enough to show that $x_{i,b(k-1)+j}\preceq y_{i',b(k-1)+j'}$ if and only if $j\leq j'$. But we have
	  $$x_{i,b(k-1)+j}=(bi,r+a(b(k-1)+j))$$
	  and
	  $$y_{i',b(k-1)+j'}=(ab/2+b(i'-1)+1,a(b(k-1)+j'+\epsilon-1)+1),$$
	  so $x_{i,b(k-1)+j}\preceq y_{i',b(k-1)+j'}$ holds if and only if $r+aj\leq a(j'+\epsilon-1)+1$. By the choice of $\epsilon$, this inequality is equivalent to $j\leq j'$, finishing our proof.

	 \begin{figure}
	 	\begin{center}
	 		\includegraphics[scale=1]{image1.eps}
	 	\end{center}
	 	\caption{Partitioning $[ab]\times [c]$ into copies of $R$}
	 	\label{image}
	 \end{figure}

\end{proof}

 First, we show that if $P=[a_{1}]\times...\times [a_{d}]$, $a_{1}$ is even, $\alpha=|P|=a_{1}...a_{d}$, $c_{1},...,c_{d-1}>3\alpha^{2}$, then the grid $G=[\alpha]\times [c_{1}]\times...\times [c_{d-1}]$ can be partitioned into copies of $P$.

 Let us proceed by induction on $d$. If $d=1$, the statement is trivial. Let us assume that $d\geq 2$ and the statement holds for all grids of dimension $d-1$. Let $a'_{1}=a_{1}a_{2}$ and $a'_{i}=a_{i+1}$ for $i\in [2,d-1]$. Define the $(d-1)$-dimensional grid $P'=[a'_{1}]\times...\times[a'_{d-1}]$. We have that $a'_{1}$ is even, $\alpha=a'_{1}...a'_{d-1}$ and $c_{1},...,c_{d-2}>3\alpha^{2}$. Hence, by our induction hypothesis, the grid $G'=[\alpha]\times [c_{1}]\times...\times [c_{d-2}]$ can be partitioned into copies of $P'$. But this gives a partition of $G=G'\times [c_{d-1}]$ into copies of $P'\times [c_{d-1}]$. Hence, it is enough to show that $P'\times [c_{d-1}]$ can be partitioned into copies of $P$.

 As  $a_{1}$ is even and $c_{d-1}\geq3\alpha^{2}\geq a_{1}^{2}a_{2}+2a_{1}$, an immediate application of Claim \ref{rectangle} shows that the rectangle $R=[a_{1}a_{2}]\times [c_{d-1}]$ can be partitioned into copies of $R'=[a_{1}]\times [a_{2}]$. But then $P'\times [c_{d-1}]\cong R\times [a_{3}]\times...\times [a_{d}]$ can be partitioned into copies of $P=R'\times [a_{3}]\times....\times [a_{d}]$ as well.

 To finish our proof, let us assume that $P=[a_{1}]\times...\times [a_{d}]$, where $a_{1}$ is not necessarily even, and $c_{1},...,c_{d-1}\geq 12|P|^{2}$. Let $P'=[2a_{1}]\times...\times [a_{d}]$. We have $|P'|=2|P|$, so by the previous argument, we have that $[|P'|]\times [c_{1}]\times...\times[c_{d-1}]$ can be partitioned into copies of $P'$. But $P'$ can be trivially  further partitioned into two copies of $P$.

\end{proof}

We shall use the following immediate corollary of the previous theorem.

\begin{corollary}\label{gridcor}
	Let $P$ be a $d$-dimensional grid and let $c_{1},...,c_{d}$ be positive integers satisfying $c_{i}\geq 12|P|^{2}$ for $i\in [d]$, and suppose that at least one of $c_{1},...,c_{d}$ is divisible by $2|P|$. Then the $d$-dimensional grid $ [c_{1}]\times...\times[c_{d}]$ can be partitioned into copies of $P$.
\end{corollary}

\begin{proof}
Without loss of generality, suppose that $c_{d}$ is divisible by $2|P|$. Then we can trivially partition $[c_{1}]\times...\times [c_{d}]$ into copies of $[2|P|]\times [c_{1}]\times...\times [c_{d-1}]$. But $[2|P|]\times [c_{1}]\times...\times [c_{d-1}]$ can be partitioned into copies of $P$ by Lemma \ref{gridintogrid}.
\end{proof}

Now we are ready to prove that we can almost partition $2^{[n]}$ into copies of a grid.

\begin{proof}[Proof of Theorem \ref{gridthm}]
Let $h=12|P|^{2}$. By Theorem \ref{chainpartition}, there exists a constant $c$ such that if $m\geq ch^{2}$, then  $2^{[m]}$ can be partitioned into chains $C_{1},...,C_{r}$ such that $h\leq |C_{1}|\leq 2h$ and $|C_{2}|=...=|C_{r}|=h$. Suppose that $n\geq cdh^{2}$, then we can find positive integers $m_{1},...,m_{d}$ such that $n=m_{1}+...+m_{d}$ and $m_{i}\geq ch^{2}$ for $i\in [d]$. Then $2^{[m_{i}]}$ has a partition into  chains $C_{i,1},...,C_{i,r_{i}}$ such that $h\leq |C_{i,1}|\leq 2h$ and $|C_{i,2}|=...=|C_{i,r_{i}}|=h$.

 The sets $C_{1,j_{1}}\times...\times C_{d,j_{d}}$ for $(j_{1},...,j_{d})\in [r_{1}]\times...\times [r_{d}]$ partition $2^{[m_{1}]}\times...\times 2^{[m_{d}]}$. Hence, as $2^{[n]}\cong 2^{[m_{1}]}\times...\times 2^{[m_{d}]}$, the Boolean lattice $2^{[n]}$ also has a partition into sets $B_{j_{1},...,j_{d}}$ for $(j_{1},...,j_{d})\in [r_{1}]\times...\times [r_{d}]$, where $B_{j_{1},...,j_{d}}$ is isomorphic to $C_{1,j_{1}}\times...\times C_{d,j_{d}}$. But then $B_{j_{1},...,j_{d}}$ is a $d$-dimensional grid isomorphic to $[|C_{1,j_{1}}|]\times...\times[|C_{d,j_{d}}|]$, where $|C_{i,j_{l}}|\geq 12|P|^{2}$ for $(i,l)\in [d]\times [d]$. If $(j_{1},...,j_{d})\neq (1,...,1)$, then we also have that at least one of $|C_{j_{1}}|,...,|C_{j_{d}}|$ is divisible by $2|P|$. Thus, applying Corollary \ref{gridcor}, $B_{j_{1},...,j_{d}}$ can be partitioned into copies of $P$ unless $(j_{1},...,j_{d})\neq (1,...,1)$. Setting $S=B_{1,...,1}$, we get that  $2^{[n]}\setminus S$ can be partitioned into copies of $P$. As
 $$|S|=|C_{1,1}|...|C_{d,1}|\leq 2^{d}h^{d}=(24|P|^{2})^{d},$$
 our proof is finished.
\end{proof}

\section{Conclusion}\label{finalproof}

In this section, we finish the proof of our main theorem and conclude with some discussion.

Let us remind the reader of the statement of our main theorem. We shall prove that if the poset $P$ has a unique maximal and minimal element, then all but a constant number of elements of $2^{[n]}$ can be covered by disjoint copies of $P$.

\begin{proof}[Proof of Theorem \ref{mainthm}]
	By Theorem \ref{gridpartitionthm}, there exists  a positive integer $d$ such that $[2|P|]^{d}$ can be partitioned into copies of $P$. Also, by Theorem \ref{gridthm}, there exists $n_{0}=\Omega(d(2|P|)^{4d})$ such that for $n>n_{0}$, all but at most $24^{d}(2|P|)^{2d^{2}}$ elements of $2^{[n]}$ can be covered by disjoint copies of $[2|P|]^{d}$.

	Setting $c(P)=\max\{2^{n_{0}},24^{d}(2|P|)^{2d^{2}}\}$, we get that all but at most $c(P)$ elements of $2^{[n]}$ can be covered by disjoint copies of $P$ for all positive integer $n$.
\end{proof}

Say that a poset $Q$ is \emph{connected} if its comparability graph is connected. The following generalization of Theorem \ref{mainthm} can be easily proved following the same line of ideas.  Let us only sketch its proof.

\begin{customthm}{B}
	Let $P,Q$ be posets such that $P$ has a unique maximal and minimal element, and $Q$ is connected. For every positive integer $n$, there exists a constant $c=c(P,Q)$ such that all but at most $c$ elements of $Q^{n}$ can be covered by copies of $P$.

	Also, if every prime divisor of $|P|$ also divides $|Q|$, then $Q^{n}$ can be partitioned into copies of $P$ for $n$ sufficiently large.
\end{customthm}

\begin{proof}[Sketch proof.]
	We are done if we prove the following generalization of Theorem \ref{gridthm}.

	\begin{customthm}{\protect\NoHyper\ref{gridthm}\protect\endNoHyper$^{+}$}
		Let $P$ be a grid and let $Q$ be a connected poset. Then there exists  $c=c(P,Q)$ such that the following holds. For every positive integer $n$, there exists $S\subset Q^{n}$ such that $Q^{n}\setminus S$ can be partitioned into copies of $P$ and $|S|\leq c$.

		Also, if every prime divisor of $|P|$ also divides $|Q|$, then $Q^{n}$ can be partitioned into copies of $P$ for $n$ sufficiently large.
	\end{customthm}

	The proof of this theorem easily follows from the combination of Corollary \ref{gridcor} and from the following generalization of Theorem \ref{chainpartition}, which appeared as Theorem 5.1 in \cite{me}.

	\begin{customthm}{\protect\NoHyper\ref{chainpartition}\protect\endNoHyper$^{+}$}(\cite{me}) Let $Q$ be a connected poset and let $c$ be a positive integer. If $n$ is sufficiently large, then $Q^{n}$ can be partitioned into chains $C_{1},...,C_{r}$ such that $c\leq |C_{1}|< 2c$ and $|C_{2}|=...=|C_{r}|=c$.
    \end{customthm}

    Again, this theorem is stated in \cite{me} without the additional condition that $c\leq |C_{1}|< 2c$, but the proof appearing in \cite{me} yields this slightly stronger result.
\end{proof}

Conjecture \ref{mainconjecture} is still open in the case $P$ does not have a unique maximal or minimal element. However, we believe that a similar approach as the one presented in this paper may lead to its proof in its full generality. Let us propose such an approach.

Let $S_{2k}$ denote the poset on $2k$ elements with partial ordering $\preceq$, whose elements can be partitioned into two $k$ element sets $A_{0},A_{1}$ such that $A_{0}$ and $A_{1}$ are antichains, and every element of $A_{0}$ is $\preceq$-smaller than every element of $A_{1}$.

\begin{enumerate}
	\item Show that for fixed $k$, if $n$ is sufficiently large, then $2^{[n]}$ can be partitioned into copies of $S_{2k}$ and a chain of size at least $k$.

	\item\label{step2} Show that if $P$ is a poset, then there exist positive integers $m$ and $t$ such that the family of copies of $P$ in $S_{2|P|}^{m}$ has a $t$-partition and a $(1\mod t)$-partition. This would  imply that $S_{2|P|}^{n}$ can be partitioned into copies of $P$ for $n$ sufficiently large.

	\item Show that for positive integers $k$ and $l$, if the positive integers $a$ and $b$ are sufficiently large, then $S_{4kl}\times [a]\times [b]$ can be partitioned into copies of $S_{2k}\times S_{2l}$. This would imply a statement similar to Lemma \ref{gridintogrid}, saying that the cartesian product $S_{2^{d}k_{1}...k_{d}}\times [a_{1}]\times..\times [a_{2d-2}]$ can be partitioned into copies of $S_{2k_{1}}\times...\times S_{2k_{d}}$, if $a_{1},...,a_{2d-2}$ are sufficiently large.
\end{enumerate}

These three steps, if proven, imply Conjecture \ref{mainconjecture} in a similar fashion as the combination of Theorem \ref{chainpartition}, \ref{gridpartitionthm}, \ref{gridthm}  imply Theorem \ref{mainthm}. The advantage of this approach is that after proving step \ref{step2}, which seems to be the most straightforward of the three steps, we can forget about the poset $P$ and we can work with the family of posets $\{S_{2k}\}_{k=1,2,...}$ instead.


A short note on short pants

Abstract: It is a theorem of Bers that any closed hyperbolic surface admits a pants decomposition consisting of curves of bounded length where the bound only depends on the topology of the surface. The question of the quantification of the optimal constants has been well studied and the best upper bounds to date are linear in genus, a theorem of Buser and Seppälä. The goal of this note is to give a short proof of an linear upper bound which slightly improves the best known bounds.

\section{Introduction} \label{introduction}
A pants decomposition of a hyperbolic surface is a maximal collection of disjoint simple closed geodesics, which as its name indicates, decomposes the surface into three holed spheres or pairs of pants. In the case of closed surfaces of genus $g\geq 2$, a pants decomposition contains $3g-3$ curves which decompose the surface into $2g-2$ pairs of pants. Any surface admits an infinite number of pants decompositions and even up to homeomorphism the number of different types of pants decomposition grows quickly (roughly like $g!$). Bers proved that there exists a constant ${\mathcal B}_g$ which only depends on the genus $g$ such that any closed hyperbolic surface of genus $g$ has a pants decomposition with all curves of length less than ${\mathcal B}_g$.

The first notable step in the direction of quantifying ${\mathcal B}_g$ was obtained by Buser \cite{BuserHab} where an upper bounds of order $g \log g$ and lower bounds of order $\sqrt{g}$ were established. The first upper bounds linear in $g$ were obtained by Buser and Sepp\"al\"a \cite{BuserSeppala92} and Buser extended these bounds to the case of variable curvature \cite{BuserBook}. The best bounds known to date \cite[Th. 5.1.4]{BuserBook} are $6\sqrt{3\pi} (g-1)$ so the best known linear factor is $ \approx 18.4$.

It should also be noted that the direct method of computing the optimal constant in each genus seems out of reach as the only known constant is ${\mathcal B}_2$, a result of Gendulphe \cite{GendulpheBers}.

The goal of this note is to offer a short proof of a linear upper bounds which provide a slight improvement on previously known bounds.

\begin{theorem}\label{thm:main}
Every closed hyperbolic surface of genus $g\geq 2$ has a pants decomposition with all curves of length at most
$$
4\pi (g-1) + 4 R_g
$$
where $R_g$ is at a logarithmic function in $g$ which can be taken to be
$$
R_g= {\,\rm arccosh}\frac{1}{\sqrt{2} \sin\frac{\pi}{12g-6}}< \log(4g-2) + {\,\rm arcsinh} \,1.
$$
\end{theorem}
The theorem provides an improvement on the factor in front of the genus from $\approx 18.4$ to $\approx 12.6$. The true growth rate of ${\mathcal B}_g$ remains unknown. It follows from the bounds in the closed case that surfaces with $n$ cusps and genus $g$ also have short pants decompositions where the bounds depend on $n$ and $g$ this time. For fixed genus and growing number of cusps, the growth rate of the optimal constants is known to grow like $\sqrt{n}$ (see \cite{Balacheff-Parlier-Sabourau, Balacheff-Parlier}) which seems to indicate that the growth rate for the closed surfaces might be of order $\sqrt{g}$. However, if one considers sums of lengths of curves in a pants decomposition instead of the maximum length then the case of cusps is very different from the genus case (compare \cite{Balacheff-Parlier-Sabourau, Guth-Parlier-Young}).

{\bf Acknowledgements.}
Some of the ideas in this paper came while I was preparing a master class at the Schr\"odinger Institute in Vienna during the special program on ``Teichm\"uller Theory", Winter 2013, and I thank the organizers for inviting me. I'd also like to thank Robert Young for his helpful comments.

\section{Preliminaries} \label{preliminaries}

To a curve $\gamma$ or a free homotopy class $[\gamma]$ of curve on a topological surface $\Sigma$ we associate a length function $\ell_{S}(\gamma)$ which associates to a hyperbolic structure $S$ on $\Sigma$ the length of the unique closed geodesic in $[\gamma]$. A first tool that we shall use is the following lemma which in particular will allow us to restrict the proof of the main theorem to the case of surfaces with systole of length at least $2 {\,\rm arcsinh} \, 1$.

\begin{lemma}[Length expansion lemma]\label{lem:LE} Let $\Sigma$ be a topological surface with $n > 0$ boundary curves $\gamma_1,\hdots,\gamma_n$. For any hyperbolic surface $S \cong \Sigma$ and any
$(\varepsilon_1,\hdots,\varepsilon_n) \in ({\mathbb R}^+)^n\setminus \{0\}$ there exists a hyperbolic surface $S'\cong \Sigma$ with
$$\ell_{S'}(\gamma_1)=\ell_S(\gamma_1)+\varepsilon_1,\hdots,\ell_{S'}(\gamma_n)=\ell_S(\gamma_n)+\varepsilon_n$$
and such that any non-trivial simple closed curve $\gamma\subset \Sigma$ satisfies
$$
\ell_{S'}(\gamma)>\ell_{S}(\gamma).
$$
\end{lemma}

This result seems to have been known for a long time, as it is claimed in \cite{ThurstonSpine} (also see \cite{ParlierLengths} for a direct proof and \cite{PapaTheretShort} for a stronger version).

The following result, due to Bavard \cite{BavardDisque}, is sharp.

\begin{lemma}[Marked systoles]\label{lem:MS} For any $x\in S$, $S$ a closed hyperbolic surface of genus $g$, there exists a geodesic loop $\delta_x$ based in $x$ such that
$$
\ell(\delta_x) \leq 2 {\,\rm arccosh} \frac{1}{2 \sin \frac{\pi}{12g-6}}.
$$
\end{lemma}

What Bavard actually proves is that the above value is a sharp bound on the diameter of the largest embedded open disk of the surface. A weaker version of this lemma can be obtained by comparing the area of an embedded disk to the area of the surface. The area of $D$ an embedded disk of radius $r$ on a hyperbolic surface is the same as the area of such a disk in the hyperbolic plane so
$$
{\rm area}(D) = 2\pi (\cosh r - 1).
$$
Comparing this to ${\rm area}(S) = 4\pi (g-1)$ shows
$$
r < 2 \log(2g-1 + \sqrt{2g(2g-2)}) < 2 \log(4g-2).
$$
This weaker bound can be found in \cite{BuserBook}[Lemma 5.2.1] but note that the order of growth of this bound is the same as in Bavard's result.

Consider a hyperbolic surface $S$ possibly with geodesic boundary. In the free homotopy class of a simple closed geodesic loop $\gamma_x$ based at a point $x\in S$ lies a unique simple closed geodesic $\gamma$ (possibly a cusp or a boundary geodesic). In the event where $\gamma$ is not a cusp, it will be useful to bound the Hausdorff distance between $\gamma$ and $x$.

\begin{lemma}
Let $S,\gamma_x,\gamma$ be as above. Then
$$
\max_{y\in \gamma} d(x,y) < {\,\rm arccosh} \left( \cosh\frac{\ell(\gamma_x)}{2} \coth \frac{\ell(\gamma)}{2}\right).
$$
\end{lemma}

\begin{proof}
Note that $\gamma_x$ and $\gamma$ bound a cylinder that can be cut into two tri-rectangles with consecutive sides of length $\sfrac{\ell(\gamma)}{2}$ and $d(\gamma_x,\gamma)$ as in figure \ref{fig:loop}.

\begin{figure}[h]
\leavevmode \SetLabels
\L(.755*.45) $d(\gamma_x,\gamma)$\\
\L(.51*.32) $\frac{\ell(\gamma)}{2}$\\
\L(.51*.84) $\frac{\ell(\gamma_x)}{2}$\\
\endSetLabels
\begin{center}
\AffixLabels{\centerline{\epsfig{file =loop.pdf,width=8.0cm,angle=0}}}
\vspace{-18pt}
\end{center}
\caption{From a geodesic loop to a closed geodesic} \label{fig:loop}
\end{figure}

Hyperbolic trigonometry in the tri-rectangle implies
\begin{equation}\label{eqn:tri}
\sinh d(\gamma_x,\gamma) \sinh \frac{\ell(\gamma)}{2} < 1.
\end{equation}
Now the maximum distance between $x$ and $\gamma$ is at most the length of the diagonal of the tri-rectangle. By hyperbolic trigonometry in one of the right angles triangles bounded by this diagonal, we obtain for all $y\in \gamma$:
$$
\cosh d(x,y) \leq \cosh d(\gamma_x,\gamma) \cosh \frac{\ell(\gamma_x)}{2}
$$
which via equation \ref{eqn:tri} becomes
\begin{eqnarray*}
d(x,y)& < &{\,\rm arccosh} \left(\cosh \left({\,\rm arcsinh} \frac{1}{\sinh\frac{\ell(\gamma)}{2}}\right) \cosh \frac{\ell(\gamma_x)}{2}\right) \\
&=& {\,\rm arccosh} \left( \cosh\frac{\ell(\gamma_x)}{2} \coth \frac{\ell(\gamma)}{2}\right).
\end{eqnarray*}
\end{proof}

It is the following corollary of these lemmas that we shall use in the sequel. It is obtained by replacing $\ell(\gamma_x)$ by Bavard's bound, $\ell(\gamma)$ with $2 {\,\rm arcsinh} 1$ and by a simple manipulation.

\begin{corollary}\label{cor:distance}
Let $\gamma_x$ be the shortest geodesic loop based in $x\in S$ a closed surface and $\gamma$ the unique closed geodesic in its homotopy class. If $\ell(\gamma)\geq 2 {\,\rm arcsinh} 1$, then for all $y\in \gamma$
$$
d(x,y) < R_g:={\,\rm arccosh}\frac{1}{\sqrt{2} \sin\frac{\pi}{12g-6}}.
$$
\end{corollary}

A further small manipulation gives the following rougher upper bound on this distance where the order of growth is more apparent:
$$
R_g < \log (4g-2) + {\,\rm arcsinh} 1.
$$

\section{Proof of main theorem}

We begin with any surface $S\in {\mathcal M}_g$ and our goal is to find a pants decomposition of $S$ which contains all simple closed geodesics of $S$ of length $\leq 2 {\,\rm arcsinh} 1$ and which has relatively short length. Recall that all simple closed geodesics of length less than $2 {\,\rm arcsinh} 1$ are disjoint, and it is for this reason that this value appears. Note that $S$ may have a pants decomposition of shorter length which doesn't contain all simple closed geodesics of length $\leq 2 {\,\rm arcsinh} 1$ but we restrict ourselves to searching for those that do. We'll call such pants decompositions {\it admissible} pants decompositions.

As we are only looking among admissible pants decompositions, we can immediately apply Lemma \ref{lem:LE} to deform our surface $S$ to a new surface $S'$ with all simple closed geodesics of length greater or equal to $2 {\,\rm arcsinh} 1$ and with the length of all curves $\gamma$ lying in admissible pants decompositions of length at least $\ell_S(\gamma)$. (If $S$ already had this property, then $S'=S$.)

We now construct algorithmically a pants decomposition of $S'$. The algorithm has two main steps and a fail-safe step.

The algorithm is initiated as follows. Consider $x_1\in S'$ and $\gamma_{x_1}$ the shortest geodesic loop based at $x_1$. We set $\gamma_1$ to be the unique closed geodesic in the same free homotopy class and we cut $S'$ along $\gamma_1$ to obtain a surface with boundary (and possibly disconnected)
$$
S_1:= S'\setminus \gamma_1.
$$
Note that as such $S_1$ is an open surface but we could equivalently treat it as a compact surface with two simple closed geodesic boundary curves by considering its closure (but not its closure {\it inside} $S$). We will proceed in the sequel in a similar way.\\

\underline{Main Step 1}

Choose $x_{k+1}\in S_k$ with $d(x_{k+1},\partial S_k) > R_g$. Consider $\gamma_{x_{k+1}}$ the shortest geodesic loop in $x_{k+1}$. Observe that in light of Corollary \ref{cor:distance} $\gamma_{x_{k+1}}$ is not freely homotopic to any of the boundary curves of $S_k$. Set $\gamma_{k+1}$ to be the unique simple closed geodesic in the same free homotopy class and consider the surface
$$
S'_{k+1}:= S_k\setminus \gamma_{k+1}.
$$
We remove any pair of pants from $S'_{k+1}$ to obtain $S_{k+1}$

If there are no more remaining $x\in S_k$ with $d(x,\partial S_k) > R_g$ we proceed to the next main step, otherwise the step is repeated. For further reference we note that all curves created in this step have length at most
$$2 {\,\rm arccosh} \frac{1}{2\sin
\frac{\pi}{12g-6}}$$
and thus in particular have length strictly less than $2R_g$.

\underline{Main Step 2}

All $x\in S_k$ satisfy $d(x,\partial S_k) \leq R_g$. Consider a point $x_{k+1} \in S_k$ such that there are two distinct geodesic paths that realize the distance from $x_{k+1}$ to $\partial S_k$. This provides a non-trivial simple path $c'$ from $\partial S_k$ to $\partial S_k$, where by non-trivial we mean that $S_k\setminus c'$ does not include a disk. In particular, in the free homotopy class of $c'$ with end points allowed to glide on the same boundary curves, there is a unique simple geodesic arc $c$ of minimal length, perpendicular in both end points to $\partial S_k$.

There are two possible topological configurations for $c$ depending on whether $c$ is a path between two distinct boundary curves or not (see figure \ref{fig:toptypes} for an illustration).

\begin{figure}[h]
\leavevmode \SetLabels
\L(.14*.79) $\alpha_1$\\
\L(.44*.79) $\alpha_2$\\
\L(.3*.08) $\tilde{\alpha}$\\
\L(.72*1.01) $\alpha$\\
\L(.535*.2) $\tilde{\alpha}_1$\\
\L(.845*.2) $\tilde{\alpha}_2$\\
\L(.3*.74) $c$\\
\L(.65*.3) $c$\\
\endSetLabels
\begin{center}
\AffixLabels{\centerline{\epsfig{file =toptypes.pdf,width=12.0cm,angle=0}}}
\vspace{-18pt}
\end{center}
\caption{The two topological types for path $c$} \label{fig:toptypes}
\end{figure}

\underline{Case 1}: If $c$ is a path between distinct boundary curves $\alpha_1$ and $\alpha_2$, then $c\cup \alpha_1 \cup \alpha_2$ is contained in a unique pair of pants $(\alpha_1,\alpha_2,\tilde{\alpha})$. We set
$$
\gamma_{k+1}:=\tilde{\alpha}
$$
and
$$S'_{k+1}:=S_k\setminus (\alpha_1,\alpha_2,\tilde{\alpha}).
$$

\underline{Case 2}: If $c$ is a path with endpoints on a single boundary curve $\alpha$ then $c\cup \alpha$ is contained in a unique pair of pants $(\alpha,\tilde{\alpha}_1,\tilde{\alpha}_2)$.

If $\tilde{\alpha}_1 \neq \tilde{\alpha}_2$ then we set
$$
\gamma_{k+1}:=\tilde{\alpha}_1, \gamma_{k+2}:=\tilde{\alpha}_2
$$
and
$$S'_{k+2}:=S_k\setminus (\alpha_1,\alpha_2,\tilde{\alpha}).
$$

If $\tilde{\alpha}_1=\tilde{\alpha}_2$ then $(\alpha_1,\alpha_2,\tilde{\alpha})$ is contained in a one holed torus $T$ and we set
$$
\gamma_{k+1}:=\tilde{\alpha}_1
$$
and
$$S'_{k+1}:=S_k\setminus T.
$$

The algorithm continues until $\gamma_{3g-3}$ is constructed, i.e., when a full pants decomposition is obtained.\\

\underline{Lengths of curves}

Begin by observing that in both types of steps described above, at each step we have
$$
\ell(\partial S_{k+1}) <  \ell(\partial S_{k})+4 R_g.
$$
Indeed: if $S_{k+1}$ is obtained by cutting along a curve as in Step 1, then the length of the curve is strictly shorter than $2R_g$ and the boundary increases by at most twice this length.

If $S_{k+1}$ is obtained as in Step 2, case 1, then the curve $\tilde{\alpha}$ is of length at most
$$\ell(\alpha_1)+\ell(\alpha_2)+4R_g.$$
As $S_{k+1}$ is obtained by removing the pair of pants with curves $\alpha_1, \alpha_2$ and $\tilde{\alpha}$, the boundary of $S_{k+1}$ no longer contains $\alpha_1$ and $\alpha_2$ and the boundary length increases by at most $4R_g$. In Step 2, case 2, one argues similarly.

In order to ensure that the length of the constructed curves does not surpass the desired length, the algorithm contains a fail-safe step. \\

\underline{Fail-safe step}

If at any step $\ell(\partial S_k) \geq 4\pi (g-1)$ then the next curve is constructed following slightly different procedure which we describe here. First observe that if
$$\ell(\partial S_k) \geq 4\pi (g-1)$$ with $S_k$ obtained as above, then
$$
\ell(\partial S_k) < 4\pi (g-1) +4 R_g
$$
as at every step boundary length cannot increase by more than $4 R_g$.

We consider an $r$-neighborhood of $\partial S_k$. For small enough $r$, this neighborhood is a union of cylinders around the boundary curves. We let $r$ grow until the topology changes, i.e., until the cylinder first bump into each other. We choose one of the geodesic paths $c$ created at the bumping point.

Here we use an area argument to bound the length of $c$. The area of an embedded $r$-neighborhood of $\ell(\partial S_k)$ is at most that of the surface thus
$$
\ell(\partial S_k) \sinh r < 4\pi(g-1).
$$
By assumption this implies
$$
r< {\,\rm arcsinh} 1
$$
and thus
$$
\ell(c) < 2 {\,\rm arcsinh} 1.
$$

As before, there are two topological types for $c$, case 1 and case 2 as above. In both cases, we borrow the notation from above, but we argue slightly differently for the lengths.

In case 1 we have a pair of pants with boundary curves $\alpha_1,\alpha_2$ and $\tilde{\alpha}$ which we decompose into two right angles hexagons. By the hexagon relations we have
\begin{eqnarray*}
\cosh \frac{\ell(\tilde{\alpha})}{2}&=& \sinh \frac{\ell(\alpha_1)}{2}\sinh \frac{\ell(\alpha_2)}{2} \cosh \ell(c) - \cosh \frac{\ell(\alpha_1)}{2}\cosh \frac{\ell(\alpha_2)}{2}\\
&<&  \sinh \frac{\ell(\alpha_1)}{2}\sinh \frac{\ell(\alpha_2)}{2} \, 3 - \cosh \frac{\ell(\alpha_1)}{2}\cosh \frac{\ell(\alpha_2)}{2}\\
&<& \cosh\left(  \frac{\ell(\alpha_1)}{2}+ \frac{\ell(\alpha_2)}{2}   \right).
\end{eqnarray*}
From this
$$
\ell(\tilde{\alpha}) < \ell(\alpha_1)+ \ell(\alpha_2).
$$
So at this step we have
$$
\ell(\partial S_{k+1}) <  \ell(\partial S_{k}).
$$
A similar (and easier) argument shows that the same conclusion holds in case 2 by looking at a pentagon decomposition of the pants $(\alpha,\tilde{\alpha}_1,\tilde{\alpha}_2)$.

Note that after a fail-safe step the boundary length decreases so it is possible that we return to Main Step 2 but otherwise we continue to create curves while decreasing the total boundary length.

All the curves $\gamma_k$ created are at one point boundary curves of a surface $S'_k$ from Main Step 1, a boundary curve of a surface $S_k$ from Main Step 2 or a boundary curve of $S_k$ from the fail-safe step. As such their lengths are all bounded by the total boundary lengths of these surfaces. Thus
$$
\ell(\gamma_k) < 4\pi (g-1) +4 R_g
$$
and the theorem is proved.

\addcontentsline{toc}{section}{References}
\def$'${$'$}

Geometric Topology (math.GT); Differential Geometry (math.DG)

A short note on short pants