Graphs and Combinatorics

, Volume 35, Issue 6, pp 1519–1540

# On the Number of Containments in P-free Families

Open Access
Original Paper

## Abstract

A subfamily $$\{F_1,F_2,\dots ,F_{|P|}\}\subseteq {{\mathcal {F}}}$$ is a copy of the poset P if there exists a bijection $$i:P\rightarrow \{F_1,F_2,\dots ,F_{|P|}\}$$, such that $$p\le _P q$$ implies $$i(p)\subseteq i(q)$$. A family $${{\mathcal {F}}}$$ is P-free, if it does not contain a copy of P. In this paper we establish basic results on the maximum number of k-chains in a P-free family $${{\mathcal {F}}}\subseteq 2^{[n]}$$. We prove that if the height of P, $$h(P) > k$$, then this number is of the order $$\Theta (\prod _{i=1}^{k+1}\left( {\begin{array}{c}l_{i-1}\\ l_i\end{array}}\right) )$$, where $$l_0=n$$ and $$l_1\ge l_2\ge \dots \ge l_{k+1}$$ are such that $$n-l_1,l_1-l_2,\dots , l_k-l_{k+1},l_{k+1}$$ differ by at most one. On the other hand if $$h(P)\le k$$, then we show that this number is of smaller order of magnitude. Let $$\vee _r$$ denote the poset on $$r+1$$ elements $$a, b_1, b_2, \ldots , b_r$$, where $$a < b_i$$ for all $$1 \le i \le r$$ and let $$\wedge _r$$ denote its dual. For any values of k and l, we construct a $$\{\wedge _k,\vee _l\}$$-free family and we conjecture that it contains asymptotically the maximum number of pairs in containment. We prove that this conjecture holds under the additional assumption that a chain of length 4 is forbidden. Moreover, we prove the conjecture for some small values of k and l. We also derive the asymptotics of the maximum number of copies of certain tree posets T of height 2 in $$\{\wedge _k,\vee _l\}$$-free families $${{\mathcal {F}}}\subseteq 2^{[n]}$$.

## Keywords

Forbidden subposet problems Comparable pairs Set systems

## 1 Introduction

In extremal set theory, many of the problems considered can be phrased in the following way: what is the size of the largest family of sets that satisfy a certain property. The very first such result is due to Sperner , which states that if $${{\mathcal {F}}}$$ is a family of subsets of $$[n]=\{1,2\dots ,n\}$$ (we write $${{\mathcal {F}}}\subseteq 2^{[n]}$$ to denote this fact), such that no pair $$F,F'\in {{\mathcal {F}}}$$ of sets are in inclusion $$F\subsetneq F'$$, then $${{\mathcal {F}}}$$ can contain at most $$\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right)$$ sets. This is sharp, as shown by $$\left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor \end{array}}\right)$$ (the family of all k-element subsets of a set X is denoted by $$\left( {\begin{array}{c}X\\ k\end{array}}\right)$$ and is called the $$k^{th}$$layer of X). This was later generalized by Erdős , who showed that if $${{\mathcal {F}}}\subseteq 2^{[n]}$$ does not contain a chain of length $$k+1$$ (i.e. nested sets $$F_1\subsetneq F_2 \subsetneq \dots \subsetneq F_{k+1}$$), then the size of $${{\mathcal {F}}}$$ is at most $$\sum _{i=1}^k\left( {\begin{array}{c}n\\ \lfloor \frac{n-k}{2}\rfloor +i\end{array}}\right)$$, the sum of the k largest binomial coefficients of order n.

If P is a poset, we denote by $$\le _P$$ the partial order on the elements of P. Generalizing Sperner’s result, Katona and Tarján  introduced the problem of determining the maximum size of a family $${{\mathcal {F}}}\subseteq 2^{[n]}$$ that does not contain sets satisfying some inclusion patterns.

### Definition 1.1

Let P be a finite poset and $${{\mathcal {F}}}\subseteq 2^{[n]}$$. A subfamily $${{\mathcal {G}}}\subseteq {{\mathcal {F}}}$$ is a (weak) copy of P if there exists a bijection $$\phi : P \rightarrow {{\mathcal {G}}}$$ such that we have $$\phi (x)\subseteq \phi (y)$$ whenever $$x \le _P y$$ holds.

Let $${{\mathcal {F}}}\subseteq 2^{[n]}$$ and let $${{\mathcal {P}}}$$ be a set of posets. We say that $${{\mathcal {F}}}$$ is $${{\mathcal {P}}}$$-free, if $${{\mathcal {F}}}$$ does not contain a copy of P for any $$P \in {{\mathcal {P}}}$$. Generally, the area of forbidden subposet problems is concerned with determining the quantity
\begin{aligned} La(n,{{\mathcal {P}}}):=\max \left\{ |{{\mathcal {F}}}|:{{\mathcal {F}}}\subseteq 2^{[n]}, ~{{\mathcal {F}}}\text { is } {{\mathcal {P}}}\text {-free}\right\} . \end{aligned}

If $${{\mathcal {P}}}=\{P\}$$ we simply denote the quantity above by La(nP). We will write $$P_k$$ for the totally ordered set (path poset) of size k and using this, Erdős’s above-mentioned result can be formulated as $$La(n,P_{k+1})=\sum _{i=1}^k\left( {\begin{array}{c}n\\ \lfloor \frac{n-k}{2}\rfloor +i\end{array}}\right)$$.

The value of La(nP) has been determined precisely or asymptotically for many posets P, but still unkown in general. Let us mention some of the results that will be important for us. Let $$\wedge _r$$ denote the poset on $$r+1$$ elements $$a, b_1, b_2, \ldots , b_r$$, where $$a > b_i$$ for all $$1 \le i \le r$$. Let $$\vee _r$$ denote the poset on $$r+1$$ elements $$a, b_1, b_2, \ldots , b_r$$, where $$a < b_i$$ for all $$1 \le i \le r$$. Katona and Tarján  proved that $$La(n,\{ \wedge _2, \vee _2 \}) =2\left( {\begin{array}{c}n-1\\ \lfloor \frac{n-1}{2}\rfloor \end{array}}\right)$$. They also showed the following.

### Theorem 1.2

(Katona, Tarján ) For any positive integer $$r \ge 2$$, we have
\begin{aligned} La(n,\vee _r) = La(n,\wedge _r) = \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \left( 1+O\left( \frac{1}{n}\right) \right) . \end{aligned}

The Hasse diagram (also known as the cover graph) of a poset P is a graph with vertex set P, where $$p,q\in P$$ are joined by an edge if $$p\le _P q$$ and there does not exist $$r\ne p,q$$ with $$p\le _P r\le _P q$$. We say that P is connected if its Hasse diagram is connected. A poset is called a tree poset if its Hasse diagram is a tree. The height of a poset P is the length of the longest chain in P. Bukh  generalized Theorem 1.2 to all tree posets, by showing that for any tree poset T of height h(T), we have $$La(n, T) = (h(T)-1 + o(1)) \left( {\begin{array}{c}n\\ \lfloor \frac{n}{2} \rfloor \end{array}}\right) .$$

Recently Gerbner et al.  initiated the investigation of counting the maximum number of copies of a poset in a family $${{\mathcal {F}}}\subseteq 2^{[n]}$$ that is $${\mathcal {P}}$$-free. More formally they introduced the following quantity: Let $${{\mathcal {F}}}\subseteq 2^{[n]}$$ and P be a poset, then let $$c(P,{{\mathcal {F}}})$$ denote the number of copies of P in $${{\mathcal {F}}}$$.

### Definition 1.3

For families of posets $${{\mathcal {P}}}$$ and $${{\mathcal {Q}}}$$ let
\begin{aligned} La(n,{{\mathcal {P}}},{{\mathcal {Q}}}):=\max \left\{ \sum _{Q\in {{\mathcal {Q}}}}c(Q,{{\mathcal {F}}}): {{\mathcal {F}}}\subseteq 2^{[n]}, ~{{\mathcal {F}}}\text { is }{{\mathcal {P}}}\text {-free}\right\} . \end{aligned}

If either $${{\mathcal {Q}}}=\{Q\}$$ or $${{\mathcal {P}}}=\{P\}$$, then we simply write $$La(n,P,{{\mathcal {Q}}})$$, $$La(n,{{\mathcal {P}}},Q)$$, La(nPQ). Note that $$La(n,{{\mathcal {P}}})=La(n,{{\mathcal {P}}},P_1)$$.

There are not many results in the literature where other posets are counted. Katona  determined the maximum number of 2-chains (copies of $$P_2$$) in a 2-Sperner ($$P_3$$-free) family $${{\mathcal {F}}}\subseteq 2^{[n]}$$, by showing $$La(n,P_3,P_2)=\left( {\begin{array}{c}n\\ i_1\end{array}}\right) \left( {\begin{array}{c}i_1\\ i_2\end{array}}\right)$$, where $$i_1,i_2$$ are chosen such that $$n-i_1,i_1-i_2$$ and $$i_2$$ differ by at most one, so $$i_1$$ is roughly 2n / 3 and $$i_2$$ is roughly n / 3. This was reproved in  and generalized by Gerbner and Patkós in , where they proved the following result.

### Theorem 1.4

(Gerbner and Patkós ) For any pair $$k>l\ge 1$$ of integers we have
\begin{aligned} La(n,P_k,P_l)= & {} \max _{0\le i_1<i_2<\cdots<i_{k-1}\le n}c\left( P_l, \bigcup _{j=1}^{k-1}\left( {\begin{array}{c}[n]\\ i_j\end{array}}\right) \right) \\= & {} \max _{0\le i_1<i_2<\cdots <i_{k-1}\le n}\prod _{j=1}^{k+1}\left( {\begin{array}{c}i_{j-1}\\ i_j\end{array}}\right) , \end{aligned}
where $$i_0=n$$. Moreover, if $$k=l+1$$, then the above maximum is attained when the integers $$i_1,i_2-i_1,\dots , i_{k-1}-i_{k-2},n-i_{k-1}$$ differ by at most one.

As the simplest poset apart from $$P_1$$ is $$P_2$$, in this paper we focus on the number of pairs in containment in a P-free family, i.e. we try to determine or estimate $$La(n,P,P_2)$$. We prove that the order of magnitude (maybe apart from a polynomial factor) depends on the height of P.

### Theorem 1.5

(i)
For any poset P of height at least 3, we have
\begin{aligned} La(n,P,P_2) = \Theta (La(n,P_3,P_2)). \end{aligned}
Moreover,
\begin{aligned} La(n,P_3,P_2)\le & {} La(n,P,P_2)\le La(n,P_{|P|},P_2) \\\le & {} \left( \left\lfloor \frac{(|P|-1)^2}{4}\right\rfloor +o(1)\right) \cdot La(n,P_3,P_2). \end{aligned}
(ii)
For any connected poset P of height 2 with at least 3 elements, we have
\begin{aligned} \Omega \left( \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \right) =La(n,P,P_2)=O\left( n2^n\right) . \end{aligned}

We believe that the upper bound in part (ii) of Theorem 1.5 can be improved by a factor of $$\sqrt{n}$$, and we propose the following conjecture.

### Conjecture 1.6

For any poset P of height 2, we have
\begin{aligned} La(n,P,P_2)\le O\left( n\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \right) . \end{aligned}

### Remark

Note that Conjecture 1.6, if true, gives the best possible order of magnitude as the family $$\left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor \end{array}}\right) \cup \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor +1\end{array}}\right)$$ is $$K_{2,2}$$-free (where $$K_{2,2}$$ denotes the poset on 4 elements abcd with $$a, b \le c, d$$), and it has $$\lceil n/2\rceil \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right)$$ containments. In fact, there are many other families that are $$K_{2,2}$$-free which have $$\Omega (n\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) )$$ containments, as discussed below.

Let $$A(n, 2\delta , k)$$ denote the size of the largest family of subsets of [n], such that each subset has size exactly k, and the symmetric difference of any pair of distinct sets is at least $$2 \delta$$. Graham and Sloane  showed that $$A(n, 2\delta , k) \ge \frac{1}{q^{\delta -1}}\left( {\begin{array}{c}n\\ k\end{array}}\right)$$, where q is any prime power with $$q \ge n$$. Let i be a fixed integer. Consider the family $${\mathcal {F}}$$ consisting of all subsets of [n] of size $$\lfloor n/2\rfloor$$, plus $$A(n, 2i, \lfloor n/2\rfloor +i)$$ subsets of size $$\lfloor n/2\rfloor +i$$, where the symmetric difference of any pair of distinct subsets is at least 2i. The number of containments in $${\mathcal {F}}$$ is at least
\begin{aligned} A(n, 2i, \lfloor n/2\rfloor +i) \left( {\begin{array}{c}\lfloor n/2\rfloor +i\\ \lfloor n/2\rfloor \end{array}}\right) = \Omega \left( \frac{1}{n^{i-1}} \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor +i\end{array}}\right) n^i \right) = \Omega \left( n\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \right) . \end{aligned}
Moreover, in $${\mathcal {F}}$$, any two sets of size $$\lfloor n/2\rfloor +i$$ intersect in at most $$\lfloor n/2\rfloor$$ elements, thus $${\mathcal {F}}$$ is $$K_{2,2}$$-free.

Using an inductive argument, we generalize Theorem 1.5 and obtain the following result on the maximum number of k-chains in a P-free family.

### Theorem 1.7

Let l be the height of P.
(i)
If $$l>k$$, then
\begin{aligned} La(n,P,P_k) = \Theta (La(n,P_{k+1},P_k)). \end{aligned}
Moreover,
\begin{aligned} La(n,P_{k+1},P_k)\le La(n,P,P_k)\le La(n,P_{|P|},P_k) \le \left( {\begin{array}{c}|P|-1\\ k\end{array}}\right) La(n,P_{k+1},P_k). \end{aligned}
(ii)
If $$l\le k$$, then
\begin{aligned} La(n,P,P_k)=O(n^{2k-1/2}La(n,P_{l},P_{l-1})), \end{aligned}
and there exists a poset P of height l such that $$La(n,P,P_k)=\Theta (La(n,P_l,P_{l-1}))$$ holds.

Then we focus on specific forbidden posets P. By generalizing a construction of Katona and Tarján, we prove the following lower bound on the maximum number of copies of $$\wedge _s$$ in $$\{\wedge _k,\vee _l\}$$-free families (note that $$P_2$$ is the special case $$\wedge _1$$).

### Theorem 1.8

For any integers kls with $$s\le k-1$$, we have
\begin{aligned} La(n,\{\wedge _k,\vee _l\},\wedge _s) \ge \left( \left( {\begin{array}{c}k-1\\ s\end{array}}\right) \frac{l-1}{k+l-2}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}

We conjecture that this lower bound is sharp.

### Conjecture 1.9

For any integers kls with $$s\le k-1$$, we have
\begin{aligned} La(n,\{\wedge _k,\vee _l\},\wedge _s)=\left( \left( {\begin{array}{c}k-1\\ s\end{array}}\right) \frac{l-1}{k+l-2}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}

We can show that the above conjecture holds in the following cases.

### Theorem 1.10

Conjecture 1.9 holds in the following cases:
1. (i)

$$s=k-1$$,

2. (ii)

$$k,l\le 5$$.

Moreover, we prove Conjecture 1.9 under the additional assumption that $$P_4$$ is forbidden. We remark that this is indeed a natural assumption, since the extremal families showing the lower bound in Theorem 1.8 do not even contain $$P_3$$ (see Sect. 3).

### Theorem 1.11

For any integers kls with $$s\le k-1$$, we have
\begin{aligned} La(n,\{\wedge _k,\vee _l,P_4\},\wedge _s)=\left( \left( {\begin{array}{c}k-1\\ s\end{array}}\right) \frac{l-1}{k+l-2}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}

### Corollary 1.12

Conjecture 1.9 holds if either k or l is at most 3.

Now we introduce some notation that is used throughout the paper.

### Notation 1.13

(Comparability graph) Given a family $${\mathcal {F}} \subset 2^{[n]}$$, the undirected comparability graph $$G_{{\mathcal {F}}}$$, and the directed comparability graph $$\overrightarrow{G}_{{\mathcal {F}}}$$ corresponding to $${\mathcal {F}}$$, are graphs whose vertex sets are equal to $${{\mathcal {F}}}$$ and whose edge sets are defined as follows: Two vertices $$F,F'\in {{\mathcal {F}}}$$ are connected by an edge/arc (i.e. directed edge) if and only if F and $$F'$$ are in containment. In $$\overrightarrow{G}_{{\mathcal {F}}}$$ the arc is directed from F to $$F'$$ if $$F'\subseteq F$$. A component of a family $${{\mathcal {F}}}$$ is a subfamily, such that the vertices of $$G_{{\mathcal {F}}}$$ corresponding to it form a connected component of $$G_{{\mathcal {F}}}$$.

### Remark

Note that the $$\wedge _k$$-free property is equivalent to the fact that the out-degree $$d^+(v)$$ of every vertex v in $$\overrightarrow{G}_{{\mathcal {F}}}$$ is at most $$k-1$$, and the $$\vee _l$$-free property is equivalent to the fact that the in-degree $$d^-(v)$$ of every vertex v in $$\overrightarrow{G}_{{\mathcal {F}}}$$ is at most $$l-1$$. The number of pairs of $${{\mathcal {F}}}$$ in containment equals the number of edges in $$G_{{\mathcal {F}}}$$ and the number of arcs in $$\overrightarrow{G}_{{\mathcal {F}}}$$ (that is, the sum of the out-degrees). More generally, we have
\begin{aligned} c(\wedge _s,{{\mathcal {F}}})=\sum _{v\in V(\overrightarrow{G}_{{\mathcal {F}}})}\left( {\begin{array}{c}d^+(v)\\ s\end{array}}\right) . \end{aligned}

Structure of the Paper. The rest of the paper is organized as follows. In Sect. 2, we prove Theorems 1.5 and 1.7, concerning general bounds on the number of containments and k-chains in P-free families, and we also determine the order of magnitude of $$La(n,T,P_2)$$ for tree posets T of height 2. In Sect. 3, we prove Theorem 1.8 by constructing a $$\{\wedge _k,\vee _l\}$$-free family with many copies of $$\wedge _s$$. In Sect. 4, we illustrate our method by proving Theorem 1.10. Finally, in Sect. 5, we prove Theorem 1.11 by applying this method.

## 2 General Bounds

In this section we prove bounds on the maximum number of pairs in containment in P-free families. In our proofs we will use the following class of posets: if $$a_1,a_2,\dots , a_s$$ are positive integers, then the complete multi-level poset$$K_{a_1,a_2,\dots ,a_s}$$ has $$\sum _{i=1}^sa_i$$ elements $$p^1_1,p^1_2,\dots p^1_{a_1},\dots ,p^s_1,p^s_2,\dots ,p^s_{a_s}$$, such that $$p^j_i< p^{j'}_{i'}$$ if and only if $$j<j'$$. Observe that any poset P of height l is contained in the l-level poset $$K_{|P|-l+1, |P|-l+1,\dots ,|P|-l+1}$$.

### Proof of Theorem 1.5

To prove (i), observe first that any P-free family is $$P_{|P|}$$-free, and if the height of P is at least 3, then any $$P_3$$-free family is P-free. This shows the first two inequalities. To prove the last inequality, first observe that by Theorem 1.4, it is enough to consider families $${{\mathcal {F}}}$$ consisting of $$|P|-1$$ full levels, and determine the value
\begin{aligned} \max _{0\le i_1<i_2<\cdots<i_{|P|-1}\le n}\sum _{1\le l<j\le |P|-1}\left( {\begin{array}{c}n\\ i_j\end{array}}\right) \left( {\begin{array}{c}i_j\\ i_l\end{array}}\right) . \end{aligned}
As claimed by Theorem 1.4, $$\left( {\begin{array}{c}n\\ i_j\end{array}}\right) \left( {\begin{array}{c}i_j\\ i_l\end{array}}\right)$$ is maximized when $$i_l,i_j-i_l$$, and $$n-i_j$$ differ by at most 1. Furthermore, if $$i_j\notin ((2/3-\varepsilon )n,(2/3+\varepsilon )n)$$ or $$i_l\notin ((1/3-\varepsilon )n,(1/3+\varepsilon )n)$$, then $$\left( {\begin{array}{c}n\\ i_j\end{array}}\right) \left( {\begin{array}{c}i_j\\ i_l\end{array}}\right) =o(\left( {\begin{array}{c}n\\ 2n/3\end{array}}\right) \left( {\begin{array}{c}2n/3\\ n/3\end{array}}\right) ) = o(La(n,P_3,P_2))$$. So, if we consider the graph G with vertex set $$\{i_1,i_2,\dots ,i_{|P|-1}\}$$, where $$i_s<i_t$$ are joined by an edge if and only if $$\left( {\begin{array}{c}n\\ i_t\end{array}}\right) \left( {\begin{array}{c}i_t\\ i_s\end{array}}\right) =\Theta (La(n,P_3,P_2))$$, then G is triangle-free. Therefore the number of edges in G is at most $$\lfloor \frac{(|P|-1)^2}{4}\rfloor$$. This finishes the proof of part (i).
The lower bound of (ii) is given by the family $${{\mathcal {F}}}_{\wedge ,\vee }$$ constructed by Katona and Tarján :
\begin{aligned} {{\mathcal {F}}}_{\wedge ,\vee }=\left( {\begin{array}{c}[n-1]\\ \lfloor \frac{n-1}{2}\rfloor \end{array}}\right) \cup \left\{ F\cup \{n\}: F\in \left( {\begin{array}{c}[n-1]\\ \lfloor \frac{n-1}{2}\rfloor \end{array}}\right) \right\} . \end{aligned}
Indeed, all the connected components of the comparability graph of $${{\mathcal {F}}}_{\wedge ,\vee }$$ have size two, so $${{\mathcal {F}}}_{\wedge ,\vee }$$ is $$\{\wedge _2,\vee _2\}$$-free and $$c(P_2,{{\mathcal {F}}}_{\wedge ,\vee })=\left( {\begin{array}{c}n-1\\ \lfloor \frac{n-1}{2}\rfloor \end{array}}\right) = \Omega \left( \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \right)$$.
To prove the upper bound of (ii), observe that if a family $${{\mathcal {F}}}\subseteq 2^{[n]}$$ is P-free, then in particular it is $$K_{|P|-1,|P|-1}$$-free, so we obtain
\begin{aligned} La(n,P,P_2)\le La(n,K_{|P|-1,|P|-1}, P_2). \end{aligned}
Therefore, to finish the proof, it is enough to show $$La(n,K_{s,s}, P_2)\le O_s(n2^n)$$ for any given integer s. Let $${{\mathcal {G}}}\subseteq 2^{[n]}$$ be a $$K_{s,s}$$-free family, and for any pair $$G,G'\in {{\mathcal {G}}}$$ with $$G\subset G'$$ let us define $$M=M(G,G')$$ to be a set with $$G\subseteq M\subseteq G'$$, which is maximal with respect to the property that there exist at least s sets $$G_1,G_2,\dots , G_s\in {{\mathcal {G}}}$$ with $$M\subsetneq G_i$$$$i=1,2,\dots ,s$$.

First let us consider those pairs $$G\subset G'$$ for which M cannot be defined. This means that G is contained in at most $$s-1$$ other sets of $${{\mathcal {G}}}$$ and thus the number of such pairs is at most $$(s-1)|{{\mathcal {G}}}|=O_s(2^n)$$.

Next, for a fixed $$M\in 2^{[n]}$$, let us consider the pairs $$G\subset G'$$ with $$M=M(G,G') = G'$$. Note that since M is contained in s sets of $${{\mathcal {G}}}$$ (and $${{\mathcal {G}}}$$ is $$K_{s,s}$$-free), M can contain at most $$s-1$$ sets from $${{\mathcal {G}}}$$. In particular, the number of pairs $$G\subset G'$$ with $$M(G,G')=G'$$ is at most $$(s-1)|{{\mathcal {G}}}|=O_s(2^n)$$.

Finally, let us consider the pairs $$G\subset G'$$ with $$M=M(G,G')\subsetneq G'$$. Each such $$G'$$ contains a set $$M'=M\cup \{x\}$$ with $$x\notin M$$. The number of such $$M'$$ is $$|G'|-|M|\le n$$, and for a given $$M'$$, the number of $$G'$$ containing $$M'$$ is at most s (namely, $$M'$$ and $$s-1$$ other sets from $${{\mathcal {G}}}$$), as otherwise $$M'$$ would be fit to play the role of $$M(G,G')$$. So the number of $$G'$$ containing M is at most sn. (Moreover, M can contain at most $$s-1$$ sets from $${{\mathcal {G}}}$$, so there are at most $$(s-1)$$ choices for G.) Therefore, the number of pairs $$G\subset G'$$ with $$M(G,G')=M$$ is at most $$(s-1) \cdot sn$$. Summing over all sets M and adding the other types of pairs in containment, we obtain
\begin{aligned} c(P_2,{{\mathcal {G}}})\le O_s(2^n)+s(s-1)n2^n = O_s(n2^n), \end{aligned}
which finishes the proof of the upper bound of (ii). $$\square$$

Before turning to the proof of Theorem 1.7, let us determine the order of magnitude of $$La(n,T,P_2)$$ for any tree poset T of height 2.

### Proposition 2.1

For any tree poset T of height 2 with $$|T|\ge 3$$, we have
\begin{aligned} La(n,T,P_2) = \Theta \left( \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \right) . \end{aligned}

### Proof

The lower bound follows from the lower bound of Theorem 1.5 (ii).

Now we prove the upper bound. Note that a T-free family $${\mathcal {F}}$$ does not contain a chain of length $$\left|{T}\right|$$. Therefore, we can partition $${\mathcal {F}}$$ into antichains $${\mathcal {A}}_1, {\mathcal {A}}_2, \ldots , {\mathcal {A}}_m$$, such that $$m \le \left|{T}\right|-1$$, where $${\mathcal {A}}_i$$ is the family of minimal elements in $${\mathcal {F}} {\setminus } (\cup _{k =1}^{i-1} {\mathcal {A}}_k)$$ for every i. Sperner’s theorem implies $$|{\mathcal {A}}_i|\le \left( {\begin{array}{c}n\\ \left\lfloor {n/2}\right\rfloor \end{array}}\right)$$ for every i.

For $$i < j$$, let $$n_{i,j}$$ be the number of containments $$A \subset B$$ such that $$A \in {\mathcal {A}}_i, B \in {\mathcal {A}}_j$$. Notice that it is impossible that $$A \subset B$$ for $$A \in {\mathcal {A}}_i$$ and $$B \in {\mathcal {A}}_j$$ when $$i > j$$, so the number of $$P_2$$’s in $${\mathcal {F}}$$ is $$\sum _{i < j} n_{i,j}$$.

We claim that for any $$1 \le i < j \le m$$, we have $$n_{i,j} \le \left|{T}\right|(\left|{{\mathcal {A}}_i}\right|+\left|{{\mathcal {A}}_j}\right|)$$. Indeed, suppose otherwise, and consider the comparability graph $$G=G_{{{\mathcal {A}}}_i\cup {{\mathcal {A}}}_j}$$. Then in G, there are at least $$\left|{T}\right| \left|{V(G)}\right|$$ edges, so the average degree in G is at least $$2\left|{T}\right|$$. It is easy to find a subgraph $$G'$$ of G with minimum degree at least $$\left|{T}\right|$$, and one can then embed T greedily into $$G'$$, giving an embedding of T into $${\mathcal {F}}$$, a contradiction.

Therefore, the number of $$P_2$$’s in $${\mathcal {F}}$$ is
\begin{aligned} \sum _{1\le i< j\le m} n_{i,j} \le \sum _{1\le i< j\le m} \left|{T}\right|(\left|{{\mathcal {A}}_i}\right|+\left|{{\mathcal {A}}_j}\right|) < \left|{T}\right|^3 \left( {\begin{array}{c}n\\ \left\lfloor {n/2}\right\rfloor \end{array}}\right) . \end{aligned}
$$\square$$

### Proof of Theorem 1.7

The proof of (i) is similar to the proof of (i) in Theorem 1.5. Observe first that any P-free family is $$P_{|P|}$$-free and any $$P_l$$-free family is P-free. This shows the first two inequalities. To prove the last inequality, consider the canonical partition of a P-free family $${{\mathcal {F}}}$$ into at most |P| antichains. We can choose k of them $$\left( {\begin{array}{c}|P|\\ k\end{array}}\right)$$ ways, and in each of the resulting k-Sperner families there are at most $$La(n,P_{k+1},P_k)$$k-chains. Note that we counted every k-chain in $${{\mathcal {F}}}$$ once.

To prove the bound in (ii), let K and $$K'$$ be the complete l-level and $$(l-1)$$-level posets with parts of size $$s=|P|-1$$. Observe that if a family $${{\mathcal {F}}}\subseteq 2^{[n]}$$ is P-free, then in particular it is K-free, so we obtain $$La(n,P,P_k)\le La(n,K, P_k)$$. We use induction on k. The base case $$k=2$$ is given by Theorem 1.5, and we note the proof is similar to the proof of Theorem 1.5. Let us also mention that the statement is trivial for $$l=1$$, hence we can assume $$l\ge 2$$.

Let $${{\mathcal {G}}}\subseteq 2^{[n]}$$ be a K-free family and consider a k-chain $${{\mathcal {C}}}$$ consisting of the sets $$G_1\subset \dots \subset G_k$$ in $${{\mathcal {G}}}$$. Let $$M=M({{\mathcal {C}}})$$ be a set with $$G_1\subset \dots \subset G_{k-1}\subseteq M\subseteq G_k$$ which is maximal with respect to the property that there exist at least s sets $$H_1,H_2,\dots , H_s\in {{\mathcal {G}}}$$ with $$M\subsetneq H_i$$$$i=1,2,\dots ,s$$. Let $${{\mathcal {M}}}=\{M({{\mathcal {C}}})~|~{{\mathcal {C}}}~ \text {is a k-chain in}\ {{\mathcal {G}}}\}$$.

We will upper bound the number of k-chains $${{\mathcal {C}}}=\{G_1\subset G_2 \subset \dots \subset G_k\}$$ (with $$G_i \in {\mathcal {G}}$$) in each of the following 3 cases separately: $$M({{\mathcal {C}}})$$ is not defined at all, $$M({{\mathcal {C}}})=G_k$$ and finally $$M({{\mathcal {C}}})\subsetneq G_k$$.

First let us consider those k-chains for which M cannot be defined. This means that $$G_{k-1}$$ is contained in at most $$s-1$$ other sets of $${{\mathcal {G}}}$$, and thus the number of such k-chains is at most $$(s-1)$$ times the number of $$(k-1)$$-chains. If $$l\le k-1$$, then by induction, the number of $$(k-1)$$-chains is at most $$O(n^{2k-2-1/2}La(n,P_{l},P_{l-1}))$$, otherwise $$l = k$$ (recall that we assumed $$l \le k$$) and then (i) shows that the number of $$(k-1)$$-chains is $$O(La(n,P_{l},P_{l-1}))$$.

Next, consider a fixed set $$M\in {{\mathcal {M}}}$$. Note that $${{\mathcal {G}}}$$ is K-free and M is contained in s sets of $${{\mathcal {G}}}$$, therefore M cannot contain $$K'$$ in $${{\mathcal {G}}}$$. In particular, the number of chains of length $$k-1$$ contained in M is at most $$O(n^{2k-2-1/2}La(|M|,P_{l-1},P_{l-2}))$$ by induction. In particular, the number of k-chains $${{\mathcal {C}}}=\{G_1\subset G_2 \subset \dots \subset G_k\}$$ for which $$M({{\mathcal {C}}})=G_k$$ is $$s \cdot O(n^{2k-2-1/2}La(|M|,P_{l-1},P_{l-2}))$$.

Finally, let us now count the chains $${{\mathcal {C}}}$$ with $$M=M({{\mathcal {C}}})\subsetneq G_k$$. Given such a chain $$G_1\subset G_2 \subset \dots \subset G_k$$, we know that $$G_k$$ contains a set $$M'=M\cup \{x\}$$ with $$x\notin M$$, as M is its proper subset. The number of such sets $$M'$$ is $$n-|M|\le n$$, and for a given $$M'$$, the number of sets in $${{\mathcal {G}}}$$ containing $$M'$$ is at most s (namely, $$M'$$ and $$s-1$$ other sets from $${{\mathcal {G}}}$$), as otherwise $$M'$$ would be fit to play the role of $$M({{\mathcal {C}}})$$. It means, given the bottom $$k-1$$ sets in a chain that are contained in M, there are at most sn ways to pick $$G_k$$. Thus the number of k-chains $${{\mathcal {C}}}$$ with $$M=M({{\mathcal {C}}})$$ is at most sn times the number of chains of length $$k-1$$ contained in M, which is at most
\begin{aligned} O(n^{2k-2-1/2})La(|M|,P_{l-1},P_{l-2}), \end{aligned}
by induction.
The total number of k-chains for which $$M({{\mathcal {C}}})$$ could be defined is then
\begin{aligned}&\sum _{M\in {{\mathcal {M}}}}O(sn \cdot n^{2k-2-1/2}La(|M|,P_{l-1},P_{l-2}))\nonumber \\&\quad =O(n^{2k-1-1/2})\sum _{i=0}^n \sum _{M\in \left( {\begin{array}{c}[n]\\ i\end{array}}\right) \cap {{\mathcal {M}}}}La(i,P_{l-1},P_{l-2}). \end{aligned}
(1)

### Claim 1

For any $$i\le n$$ we have
\begin{aligned} \sum _{M\in \left( {\begin{array}{c}n\\ i\end{array}}\right) \cap {{\mathcal {M}}}}La(i,P_{l-1},P_{l-2})\le La(n,P_l,P_{l-1}). \end{aligned}

### Proof

By Theorem 1.4, there are integers $$i_1,\dots ,i_{l-2}$$, such that $$La(i,P_{l-1},P_{l-2})$$ is the number of $$(l-2)$$-chains in the family consisting of all sets of sizes $$i_1,\dots ,i_{l-2}$$ in $$2^{[i]}$$. Therefore, $$\sum _{M\in \left( {\begin{array}{c}n\\ i\end{array}}\right) }La(i,P_{l-1},P_{l-2})$$ is equal to the number of $$(l-1)$$-chains consisting of sets of size $$i_1,\dots ,i_{l-2},i$$. As these $$l-1$$ levels do not contain $$P_l$$, the number of $$(l-1)$$-chains is at most $$La(n,P_l,P_{l-1})$$ by definition. $$\square$$

Using the above claim and (1), we obtain that the number of k-chains for which $$M({{\mathcal {C}}})$$ could be defined is $$\sum _{i=0}^nO(n^{2k-1-1/2})La(n,P_l,P_{l-1})=O(n^{2k-1/2})La(n,P_l,P_{l-1})$$. We already obtained that the number of k-chains for which $$M({{\mathcal {C}}})$$ could not be defined is $$O(n^{2k-2-1/2})La(n,P_{l},P_{l-1})$$, which finishes the proof of the upper bound in (ii).

Now we prove the remaining part of (ii). Let $$K=K_{s,s,\dots ,s}$$ be the complete l-level poset with $$s> k-l+1$$. Let $$i_1,i_2,\dots , i_{l-1}$$ be integers such that $$n-(k-l+1)-i_1,i_1-i_2,\dots ,i_{l-2}-i_{l-1},i_{l-1}$$ differ by at most 1. By Theorem 1.4, we know that the family $${{\mathcal {G}}}'=\cup _{j=1}^{l-1}\left( {\begin{array}{c}[n-(k-l+1)]\\ i_j\end{array}}\right)$$ realizes $$La(n-(k-l+1),P_l,P_{l-1})$$. Since $${{\mathcal {G}}}'$$ is $$(l-1)$$-Sperner, if we add sets to $${{\mathcal {G}}}'$$ such that no two $$G,G'\in \left( {\begin{array}{c}[n-(k-l+1)]\\ i_{l-1}\end{array}}\right)$$ are contained in the same newly added sets, then the resulting family will be K-free. Let A denote the set of integers at least $$n-(k-l+1)+1$$ and at most $$n-(k-l+1)+j$$, i.e. $$A=[n-(k-l+1)+j]{\setminus } [n-(k-l+1)]$$. If we add the sets
\begin{aligned} \left\{ A\cup G: j\in [k-l+1], G\in \left( {\begin{array}{c}[n-(k-l+1)]\\ i_{l-1}\end{array}}\right) \right\} \end{aligned}
to $${{\mathcal {G}}}'$$ and denote the resulting family by $${{\mathcal {G}}}$$, then we have
\begin{aligned} c({{\mathcal {G}}},P_k)=c({{\mathcal {G}}}',P_{l-1})=La(n-(k-l+1),P_l,P_{l-1})=\Omega _{k,l}(La(n,P_l,P_{l-1})). \end{aligned}
This finishes the proof. $$\square$$

## 3 Proof of Theorem 1.8: Construction

We need to show a $$\{ \wedge _k,\vee _l\}$$-free family $${{\mathcal {F}}}_{n,k,l}\subseteq 2^{[n]}$$ with $$c({{\mathcal {F}}}_{n,k,l},\wedge _s)=\left( \left( {\begin{array}{c}k-1\\ s\end{array}}\right) \frac{l-1}{k+l-2}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right)$$. Let us partition [n] into $$A_1,A_2,\dots , A_m,A_{m+1}$$ with $$m=\lfloor \frac{n}{k+l-3}\rfloor$$ and $$|A_i|=k+l-3$$ for all $$i=1,2,\dots ,m$$. Let us define the family
\begin{aligned} {{\mathcal {F}}}_{n,k,l}= & {} \cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^+\cup \cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^-, \ \text { where}\\ {{\mathcal {F}}}_{n,k,l,j}^+= & {} \left\{ F\in \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor +1\end{array}}\right) : |F\cap A_j|=k-1, \text { and } \quad \forall i<j \text { we have } \right. \\&\left. \quad |F\cap A_i|\ne k-2,\ k-1\right\} , \\ {{\mathcal {F}}}_{n,k,l,j}^-= & {} \left\{ F\in \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor \end{array}}\right) : |F\cap A_j|=k-2, \quad \right. \\&\left. \text { and } \forall i<j \text { we have } \quad |F\cap A_i|\ne k-2,\ k-1\right\} . \end{aligned}

### Remark

Observe that if $$k=l=2$$, then $$k-2=0,k-1=1, k+l-3=1$$. In particular, $$|A_1|=1$$ and let $$A_1 = \{ 1\}$$. So, $${{\mathcal {F}}}^+_{n,2,2,1}=\{F\in \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor +1\end{array}}\right) : 1\in F\}$$ and $${{\mathcal {F}}}^-_{n,2,2,1}=\{F\in \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor \end{array}}\right) : 1\notin F\}$$. As every set F intersects $$A_1 = \{ 1\}$$ in either 0 or 1 element, all other $${{\mathcal {F}}}^+_{n,2,2,j}$$’s and $${{\mathcal {F}}}^-_{n,2,2,j}$$’s are empty and thus $${{\mathcal {F}}}_{n,2,2}$$ is equal (up to permutations of the ground set) to the family $${{\mathcal {F}}}_{\wedge ,\vee }$$ of Katona and Tarján described in the proof of Theorem 1.5.

First we show that $${{\mathcal {F}}}_{n,k,l}$$ is $$\{\wedge _k,\vee _l\}$$-free. As sets in $${{\mathcal {F}}}_{n,k,l}$$ are of size $$\lfloor n/2 \rfloor$$ and $$\lfloor n/2 \rfloor +1$$, if $$F\subset G$$ holds for some $$F,G\in {{\mathcal {F}}}_{n,k,l}$$, then we have $$F\in \cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^-,G\in \cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^+$$. Let j(F) and j(G) be the indices with $$F\in {{\mathcal {F}}}_{n,k,l,j(F)}^-, \ G\in {{\mathcal {F}}}_{n,k,l,j(G)}^+$$. We claim that $$j(F)=j(G)$$ holds. Indeed, if $$j(G)< j(F)$$ (the case $$j(G)>j(F)$$ is similar), then $$F\subset G$$ implies $$|F\cap A_{j(G)})|\le k-3$$ (indeed, if the intersection size is equal to $$k-2$$, then $$j(F)=j(G)$$ would hold, if it is $$k-1$$, it would mean that F is not in the family, and if it is more than $$k-1$$, it would mean G does not contain F). Thus
\begin{aligned} |F\cap ([n]{\setminus } A_{j(G)})|\ge \lfloor n/2\rfloor -(k-3)>\lfloor n/2\rfloor +1-(k-1)=|G\cap ([n]{\setminus } A_{j(G)})|, \end{aligned}
contradicting $$F\subset G$$.
Furthermore, if $$j(F)=j(G)$$, then $$|F\cap ([n]{\setminus } A_{j(G)})|=|G\cap ([n]{\setminus } A_{j(G)})|$$, so G contains those sets of $${{\mathcal {F}}}_{n,k,l}$$ that are of the form $$G{\setminus } \{a\}$$ with $$a\in G\cap A_{j(G)}$$. By definition of $${{\mathcal {F}}}_{n,k,l,j}^+$$, there are $$k-1$$ such a’s. Similarly, any F is contained in those sets of $${{\mathcal {F}}}_{n,k,l}$$ that are of the form $$F\cup \{a\}$$ with $$a\in A_{j(F)}{\setminus } F$$. By definition of $${{\mathcal {F}}}_{n,k,l,j}^-$$ there are $$k+l-3-(k-2)=l-1$$ such a’s. Therefore, $${{\mathcal {F}}}_{n,k,l}$$ is indeed $$\{\wedge _k,\vee _l\}$$-free. Moreover, we have
\begin{aligned} c(\wedge _s,{{\mathcal {F}}}_{n,k,l})=\left( {\begin{array}{c}k-1\\ s\end{array}}\right) |\cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^+|. \end{aligned}
Therefore, it remains to show that $${{\mathcal {F}}}^+_{n,k,l}:=\cup _{j=1}^m{{\mathcal {F}}}_{n,k,l,j}^+$$ has size $$(\frac{l-1}{k+l-2}+o(1))\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor + 1\end{array}}\right)$$. To do this, let us introduce
\begin{aligned} p_1:=\frac{\left( {\begin{array}{c}k+l-3\\ k-1\end{array}}\right) }{2^{k+l-3}} \quad \text {and} \quad p_2:=\frac{2^{k+l-3}-\left( {\begin{array}{c}k+l-3\\ k-1\end{array}}\right) -\left( {\begin{array}{c}k+l-3\\ k-2\end{array}}\right) }{2^{k+l-3}}. \end{aligned}
Let us bound $$|{{\mathcal {F}}}^+_{n,k,l,j}|$$ from below: given $$H\subseteq \cup _{i=1}^jA_i$$ with $$|H\cap A_j|=k-1$$ and $$|H\cap A_i|\ne k-1,k-2$$, let
\begin{aligned} {{\mathcal {F}}}_H := \{F\in \left( {\begin{array}{c}[n]\\ \lfloor n/2\rfloor +1\end{array}}\right) : F\cap \cup _{i=1}^jA_i=H\}. \end{aligned}
Clearly, $${{\mathcal {F}}}^+_{n,k,l,j}$$ is the union of $${{\mathcal {F}}}_H$$’s over all H satisfying the required intersection property. Also, we have
\begin{aligned} |{{\mathcal {F}}}_H|=\left( {\begin{array}{c}n-j(k+l-3)\\ \lfloor n/2\rfloor +1-|H|\end{array}}\right) . \end{aligned}
Observe that $$0\le |H|\le j(k+l-3)$$. So $$j\le \log n$$ implies that for any $$\varepsilon >0$$ and H with the above property, if n is large enough, then we have
\begin{aligned} 2^{j(k+l-3)}\left( {\begin{array}{c}n-j(k+l-3)\\ \lfloor n/2\rfloor +1-|H|\end{array}}\right) \ge (1-\varepsilon )\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor +1\end{array}}\right) . \end{aligned}
As the number of sets H possessing the required intersection property is $$(p_22^{k+l-3})^{j-1}p_12^{k+l-3}$$, we obtain
\begin{aligned} |{{\mathcal {F}}}^+_{n,k,l}|\ge (1-\varepsilon )\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor +1\end{array}}\right) \sum _{j=1}^{\log n}p_2^{j-1}p_1\ge (1-\varepsilon ')\frac{p_1}{1-p_2}\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor +1\end{array}}\right) . \end{aligned}
This finishes the proof as
\begin{aligned} \frac{p_1}{1-p_2}=\frac{l-1}{k+l-2}. \end{aligned}
$$\square$$

## 4 Overview of Our Method and Proof of Theorem 1.10

### Proof of Theorem 1.10 (i)

Let $${{\mathcal {F}}}\subseteq 2^{[n]}$$ be a $$\{\wedge _k,\vee _l\}$$-free family and let us consider $$\overrightarrow{G}_{{{\mathcal {F}}}}$$, its directed comparability graph. Let A denote the set of vertices with out-degree $$k-1$$. As $${{\mathcal {F}}}$$ is $$\wedge _k$$-free, this is the maximum out-degree and $$c(\wedge _{k-1},{{\mathcal {F}}})=|A|$$. Observe that $$d^-(a)=0$$ for any $$a\in A$$, as if $$(b,a)\in E(\overrightarrow{G}_{{{\mathcal {F}}}})$$ (i.e., there is a directed edge from b to a), then $$d^+(b)\ge k$$ would hold (every out-neighbor of a would be an out-neighbor of b in addition to a), contradicting the $$\wedge _k$$-free property of $${{\mathcal {F}}}$$. This implies that A is an independent set in $$\overrightarrow{G}_{{{\mathcal {F}}}}$$ and there is no edge from $$B=V(\overrightarrow{G}_{{{\mathcal {F}}}}){\setminus } A$$ to A. As $${{\mathcal {F}}}$$ is $$\vee _l$$-free also, the in-degree of every vertex in B is at most $$l-1$$. Therefore, double counting the edges between A and B we obtain
\begin{aligned} (k-1)|A|\le (l-1)|B|=(l-1)(|{{\mathcal {F}}}|-|A|). \end{aligned}
Rearranging gives
\begin{aligned} c(\wedge _{k-1},{{\mathcal {F}}})=|A|\le \frac{l-1}{k+l-2}|{{\mathcal {F}}}|\le \left( \frac{l-1}{k+l-2}+o(1)\right) \left( {\begin{array}{c}n\\ n/2\end{array}}\right) , \end{aligned}
where for the last inequality we used Theorem 1.2. One can see that this bound is sharp by putting $$s = k-1$$ in Theorem 1.8. $$\square$$

Below we show that if the construction $${{\mathcal {F}}}_{n,k,l}$$ (defined in Sect. 3) maximizes the number of containments, then it maximizes the number of certain subposets in the family as well.

### Lemma 4.1

Assume that for some fixed integers kl we have
\begin{aligned} La(n,\{\wedge _k,\vee _l\}, P_2)=\left( \frac{(k-1)(l-1)}{k+l-3}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}
Let P be a poset on two levels not containing $$\wedge _k$$ and $$\vee _l$$ as a subposet. Also assume that the Hasse diagram of P is a tree containing no 6-edge path. Then the number of copies of P in a $$\{\wedge _k,\vee _l\}$$-free family $${{\mathcal {F}}}\subset 2^{[n]}$$ is asymptotically maximized by the construction $${{\mathcal {F}}}_{n,k,l}$$.

### Proof

We already showed that every set $$v\in {{\mathcal {F}}}^+_{n,k,l}$$ has $$d^+(v)=k-1$$ and every set $$v\in {{\mathcal {F}}}^-_{n,k,l}$$ has $$d^-(v)=l-1$$. (Actually, $${{\mathcal {F}}}_{n,k,l}$$ consists of several copies of the poset formed by the $$(k-2)$$-th and $$(k-1)$$-th levels of the Boolean lattice of order $$k+l-3$$.)

We try to find an embedding f of P into a $$\{\wedge _k,\vee _l\}$$-free family $${{\mathcal {F}}}\subset 2^{[n]}$$. First, pick an edge of the Hasse diagram of P and embed its endpoints to two sets of $${{\mathcal {F}}}$$. We have as many possibilities as the number of containments among sets in $${{\mathcal {F}}}$$. By Theorem 1.8 and our assumption, this is asymptotically maximized by $${{\mathcal {F}}}={{\mathcal {F}}}_{n,k,l}$$.

We continue the embedding of the points of P as follows. We pick a point $$p\in P$$ that is already embedded, and embed all points that are connected to p in the Hasse diagram and are not already embedded. If p is in the upper (or lower) level of P, then the number of our possibilities is maximal if $$d^+(f(p))=k-1$$ (or $$d^-(f(p))=l-1$$, respectively). This is true if $${{\mathcal {F}}}={{\mathcal {F}}}_{n,k,l}$$. Moreover, if $${{\mathcal {F}}}={{\mathcal {F}}}_{n,k,l}$$, we will not get stuck during the embedding when trying to embed a point $$p\in P$$ into a set $$F\in {{\mathcal {F}}}$$ that is already used, because the comparability graph of $${{\mathcal {F}}}_{n,k,l}$$ has no cycle shorter than 6 edges and the Hasse diagram of P contains no 6-edge path. $$\square$$

We can use the above lemma in the case $$P=\wedge _s$$ ($$s\le k-1$$), to obtain the following:

### Corollary 4.2

If for some fixed integers kl we have
\begin{aligned} La(n,\{\wedge _k,\vee _l\}, P_2)=\left( \frac{(k-1)(l-1)}{k+l-3}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) , \end{aligned}
then for any $$s\le k-1$$ we have
\begin{aligned} La(n,\{\wedge _k,\vee _l\},\wedge _s)=\left( \left( {\begin{array}{c}k-1\\ s\end{array}}\right) \frac{l-1}{k+l-3}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}

By Corollary 4.2, notice that in order to prove part (ii) of Theorem 1.10, it suffices to prove that $$La(n,\{\wedge _k,\vee _l\}, P_2)=\left( \frac{(k-1)(l-1)}{k+l-3}+o(1)\right) \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right)$$ for $$k, l \le 5$$. We will prove this in the next subsection, by introducing a new method.

### 4.2 Overview of our method

In this subsection we illustrate our method by showing part (ii) of Theorem 1.10. We start by giving a detailed proof of
\begin{aligned} La(n,\{\wedge _4,\vee _4\}, P_2)=\frac{3}{2}\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) \left( 1+O\left( \frac{1}{n}\right) \right) . \end{aligned}
(2)
Then applying Corollary 4.2, this would complete the proof of Theorem 1.10 (ii) in the case $$k = l = 4$$ (as noted before). Note that the lower bound in (2) follows from Theorem 1.8. Now we show the upper bound.

Proof of Theorem 1.10(ii) for$$k = l = 4$$

Let $${\mathcal {F}}$$ be a $$\{\wedge _4,\vee _4\}$$-free family of subsets of [n]. Let $$G_{{\mathcal {F}}}$$ be the comparability graph corresponding to $${\mathcal {F}}$$ (see Notation 1.13). Let $${\mathcal {K}}$$ be the set consisting of the vertex sets of all (maximal) connected components of $$G_{{\mathcal {F}}}$$. Clearly,
\begin{aligned} \left|{{\mathcal {F}}}\right| = \sum _{C \in {\mathcal {K}}} \left|{C}\right|. \end{aligned}
(3)
For the sake of brevity, we refer to a connected component just by its vertex set. Observe that, by definition, for any two connected components $$C_1, C_2 \in {\mathcal {K}}$$, the elements $$v_1 \in C_1$$ and $$v_2 \in C_2$$ are unrelated. For each connected component of $$G_{{\mathcal {F}}}$$ with vertex set $$C \in {\mathcal {K}}$$, let $$G_C$$ be the subgraph of $$G_{{\mathcal {F}}}$$ induced by C. Then the number of containments in $${\mathcal {F}}$$ is
\begin{aligned} c(P_2, {\mathcal {F}}) = \sum _{C \in {\mathcal {K}}} \left|{E(G_C)}\right|. \end{aligned}
(4)
Suppose that for each connected component $$C \in {\mathcal {K}}$$, the following inequality holds.
\begin{aligned} \left|{E(G_C)}\right| \le \frac{3}{2} \left|{C}\right|. \end{aligned}
(5)
Then by (3) and (4) we would get that $$c(P_2, {\mathcal {F}}) \le \frac{3}{2} \left|{{\mathcal {F}}}\right|$$, and by Theorem 1.2 we are done. But this is not necessarily true: Consider the connected component S with elements abcde where $$a, b< v < d, e$$. Then $$G_S$$ has 8 edges but $$\left|{S}\right| = 5$$, so (5) does not hold. In fact, we claim that if there is a connected component in $$G_{{\mathcal {F}}}$$ for which (5) does not hold, then it must be isomorphic to $$G_S$$. Indeed, notice that for a connected component C, if each vertex has degree at most 3 in $$G_C$$, then the inequality (5) trivially holds. So we can assume that $$G_C$$ must have a vertex v of degree at least 4. Now, it is impossible that v is larger or smaller than 4 elements in C, since $${\mathcal {F}}$$ is $$\{\wedge _4,\vee _4\}$$-free. Moreover, it is also impossible that v is larger than 3 elements abc and smaller than an element d, since then d is above 4 elements of C, a contradiction. Similarly, it is impossible that v is smaller than 3 elements and larger than an element of C. Therefore, the only possibility is that v is larger than exactly 2 elements ab and smaller than exactly 2 elements de. Moreover, it is easy to check that in this case, the elements abcd cannot be related to any other elements, proving our claim.

In order to fix the above mentioned problem, our idea is the following. We add some sets to $${\mathcal {F}}$$ to produce a new family $${\mathcal {G}}$$: Consider each subfamily $${\mathcal {S}}_i = \{A_i, B_i, V_i, D_i, E_i\}$$ (with $$A_i, B_i \subset V_i\subset D_i, E_i$$ and $$1 \le i \le m$$) of $${\mathcal {F}}$$, corresponding to a connected component of $$G_{{\mathcal {F}}}$$ which is isomorphic to $$G_S$$, and add exactly one set $$F_i \in [A_i, D_i] {\setminus } \{V_i\}$$ to it, where $$[A_i, D_i]:=\{V \in 2^{[n]}: A_i \subsetneq V \subsetneq D_i\}$$. Let $${\mathcal {S}}'_i = {\mathcal {S}}_i \cup \{F_i\}$$ and let $${{\mathcal {G}}}= {{\mathcal {F}}}\cup \{F_1, F_2, \ldots , F_m\}$$. We claim that each newly added set $$F_i \in {\mathcal {S}}'_i$$ is unrelated to all the other sets $$L \in {\mathcal {G}} {\setminus } {\mathcal {S}}'_i$$. Indeed, if $$L \in {\mathcal {G}} {\setminus } {\mathcal {F}}$$ – i.e., say $$L = F_j$$ for some $$j \not = i$$ – then either $$A_i$$ or $$B_i$$ is related to $$A_j$$ or $$B_j$$, contradicting the assumption that they correspond to elements in different components of $$G_{{\mathcal {F}}}$$. If $$L \in {\mathcal {F}}$$, then again either $$A_i$$ or $$B_i$$ is related to L, a contradiction. This claim shows that the connected components of the comparability graph $$G_{{\mathcal {G}}}$$ corresponding to $${\mathcal {G}}$$ are the same as those of $$G_{{\mathcal {F}}}$$, except that the components isomorphic to $$G_S$$ in $$G_{{\mathcal {F}}}$$ are replaced by $$G_{S'}$$. Therefore, any set of $${\mathcal {G}}$$ is related to at most one of the newly added sets $$F_i$$. So $${\mathcal {G}}$$ is $$\{\wedge _5,\vee _5\}$$-free.

Let $${\mathcal {K}}'$$ be the set consisting of the vertex sets of connected components of $$G_{{\mathcal {G}}}$$. For each connected component $$C \in {\mathcal {K}}' \cap {\mathcal {K}}$$, the inequality (5) holds. As we already noted, for each connected component $$C \in {\mathcal {K}}' {\setminus } {\mathcal {K}}$$, $$G_C$$ is isomorphic to $$G_{S'}$$. Moreover, since $$\left|{S'}\right| = 6$$ and $$\left|{E(G_S)}\right| = 8$$, we have $$\left|{E(G_S)}\right| \le \frac{3}{2} \left|{S'}\right|$$. Therefore, by (4),
\begin{aligned} c(P_2, {\mathcal {F}}) = \sum _{C \in {\mathcal {K}}} \left|{E(G_C)}\right| \le \frac{3}{2} \sum _{C \in {\mathcal {K}}'} \left|{C}\right| = \frac{3}{2} \left|{{\mathcal {G}}}\right|. \end{aligned}
On the other hand, $$\left|{{\mathcal {G}}}\right| = \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) (1+O(\frac{1}{n}))$$ by Theorem 1.2, since $${\mathcal {G}}$$ is $$\{\wedge _5,\vee _5\}$$-free. Combining this with the above inequality, the proof is complete. $$\square$$

We leave the proof of the cases $$k=4,l=5$$ and $$k=5,l=4$$ to the reader and sketch the proof of the most technical of the cases: $$k=5,l=5$$.

Proof of Theorem 1.10(ii) for$$k = l = 5$$

Again the lower bound follows from Theorem 1.8. Now we show the upper bound. Consider a $$\{\wedge _5,\vee _5\}$$-free family $${{\mathcal {F}}}$$ and its comparability graphs $$G_{{\mathcal {F}}}$$ and $$\overrightarrow{G}_{{\mathcal {F}}}$$. Recall that, for any $$F \in {{\mathcal {F}}}$$, d(F) denotes the degree of F in $${G}_{{\mathcal {F}}}$$ and $$d^+(F), d^-(F)$$ denote the out degree and in degree of F in $$\overrightarrow{G}_{{\mathcal {F}}}$$ respectively. We want to show that the number of edges in $$G_{{\mathcal {F}}}$$ is at most $$(2+O(1/n))\left( {\begin{array}{c}n\\ n/2\end{array}}\right)$$. (Then we would be done by applying Corollary  4.2.) Equivalently, we would like to show that $$\sum _{F\in {{\mathcal {F}}}}d(F)=\sum _{F\in {{\mathcal {F}}}}(d^+(F)+d^-(F))$$ is at most $$(4+O(1/n))\left( {\begin{array}{c}n\\ n/2\end{array}}\right)$$. We say that a set $$F\in {{\mathcal {F}}}$$ is problematic if $$d(F)\ge 5$$. As $${{\mathcal {F}}}$$ is $$\{\wedge _5,\vee _5\}$$-free, trivially, we have $$d(F)\le 8$$ for any $$F\in {{\mathcal {F}}}$$. Moreover, notice that F cannot be a problematic set if $$d^+(F)=0$$ or $$d^-(F)=0$$. So there is a set D contained in F, which implies that F is contained in at most 3 sets (otherwise, D would be contained in 5 sets, contradicting the $$\vee _5$$-free property of $${{\mathcal {F}}}$$). By a symmetric argument, we can conclude that F contains at most 3 sets, implying $$d(F)\le 6$$. (Similar reasoning shows that if $${{\mathcal {F}}}$$ is $$\{\wedge _k,\vee _l\}$$-free, then $$d(F)\le k-2+l-2$$ holds.) Let $${{\mathcal {F}}}_1$$ denote the family of problematic sets. As noted before, for any $$F \in {{\mathcal {F}}}_1$$ we have $$1 \le d^+(F), d^-(F) \le 3$$. Consider $$U_1,\ldots ,U_{d^-(F)}$$ with $$F \subseteq U_i$$ for $$1\le i \le d^-(F)$$, and $$D_1,\ldots ,D_{d^{+}(F)}$$ with $$D_j \subseteq F$$ for $$1 \le j \le d^{+}(F)$$. Let us define the following family
\begin{aligned} {{\mathcal {N}}}(F):=\{(U_i{\setminus } F)\cup D_j : 1\le i \le d^+(F), 1 \le j \le d^{-}(F)\}. \end{aligned}
As the $$U_i$$’s are distinct supersets of F and the $$D_j$$’s are dstinct subsets of F, we obtain that $$|{{\mathcal {N}}}(F)|=d^-(F)d^{+}(F)$$ and $${{\mathcal {N}}}(F) \cap \{U_1,\ldots ,U_{d^+(F)},D_1,\ldots ,D_{d^{-}(F)}\}=\emptyset$$.

### Claim 2

For any $$F\in {{\mathcal {F}}}_1$$ we have $${{\mathcal {N}}}(F){\setminus } {{\mathcal {F}}}\ne \emptyset$$.

### Proof

For any $$F\in {{\mathcal {F}}}_1$$ we have $$\max \{d^+(F),d^-(F)\}\ge 3$$ (in fact, $$\max \{d^+(F),d^-(F)\} = 3$$ since $$d^+(F),d^-(F) \le 3$$). Suppose $$d^-(F)\ge 3$$ (the case when $$d^+(F)\ge 3$$ is similar), and with the above notation let us consider the sets $$(U_i{\setminus } F)\cup D_1$$ ($$i=1,2,3$$). They are all distinct and do not contain F. If they all belong to $${{\mathcal {F}}}$$, then $$D_1$$ is contained in at least 7 sets, contradicting the $$\vee _5$$-free property of $${{\mathcal {F}}}$$. $$\square$$

### Claim 3

For any pair $$F,F'\in {{\mathcal {F}}}_1$$ we have $$({{\mathcal {N}}}(F){\setminus } {{\mathcal {F}}})\cap ({{\mathcal {N}}}(F'){\setminus } {{\mathcal {F}}})=\emptyset$$.

### Proof

Suppose to the contrary that $$G\in ({{\mathcal {N}}}(F){\setminus } {{\mathcal {F}}})\cap ({{\mathcal {N}}}(F'){\setminus } {{\mathcal {F}}})$$ for some $$F,F'\in {{\mathcal {F}}}_1$$.

Case I:$$F,F'$$ are in containment, say $$F\subsetneq F'$$.

In this case the component of $$F,F'$$ in $${{\mathcal {F}}}$$ consists of six sets $$D_1,D_2\subset F\subset F'\subset U_1,U_2$$. Observe that every set in $${{\mathcal {N}}}(F)$$ contains an element in $$F' {\setminus } F$$ while this does not hold for any set in $$N(F')$$.

Case II:$$F,F'$$ are not in containment.

Recall that we have $$\max \{d^+(F),d^-(F)\} = 3$$. In this case, we may assume $$d^-(F)=3$$ as the case $$d^+(F)=3$$ is symmetric. Let $$U_1,U_2,U_3\in {{\mathcal {F}}}$$ and $$U_1',U_2'\in {{\mathcal {F}}}$$ contain F and $$F'$$ respectively and let $$D_1,D_2,D_1',D_2'\in {{\mathcal {F}}}$$ with
\begin{aligned} D_1,D_2\subset F,\ D_1',D_2'\subset F', \end{aligned}
such that $$D_1\subset G\subset U_1$$ and $$D_1'\subset G\subset U_1'$$ hold. If $$U_1'$$ is not among the $$U_i$$’s, then $$D_1$$ is contained in at least 5 sets in $${{\mathcal {F}}}$$, contradicting the $$\vee _5$$-free property of $${{\mathcal {F}}}$$. Now $$U_1'$$ contains $$F,F'$$ and thus $$D_1,D_2,D_1',D_2'$$, so unless $$\{D_1,D_2\}=\{D_1',D_2'\}$$, we obtain a $$\wedge _5$$ in $${{\mathcal {F}}}$$. But if $$D_1=D_i'$$ for some $$i=1,2$$, then $$D_1$$ is contained in $$F,F'$$ and $$U_1,U_2,U_3$$, contradicting the $$\wedge _5$$-free property of $${{\mathcal {F}}}$$. $$\square$$

### Claim 4

The family $${{\mathcal {G}}}:={{\mathcal {F}}}\cup (\cup _{F\in {{\mathcal {F}}}_1}{{\mathcal {N}}}(F))$$ is $$\{\wedge _{41},\vee _{41}\}$$-free.

### Proof

Suppose not, and let $$D,U_1,U_2,\dots , U_{41}$$ be a copy of $$\vee _{41}$$ in $${{\mathcal {G}}}$$. (The $$\wedge _{41}$$ case is similar.) We can assume that $$D \in {{\mathcal {F}}}$$, as every set $$G\in {{\mathcal {G}}}$$ contains a set (maybe itself) from $${{\mathcal {F}}}$$. Observe that if D is contained in $$G\in {{\mathcal {G}}}$$, then G has the form of $$G=D'\cup (U'{\setminus } F')$$, where $$D', F', U' \in {{\mathcal {F}}}$$, with $$D'\subset F'\subset U'$$. In particular $$D\subset U'$$, and as $${{\mathcal {F}}}$$ is $$\vee _5$$-free, there are at most 4 choices of $$U'$$. Because of the $$\wedge _5$$-free property, for each such $$U'$$, there exist at most $$3\times 3=9$$ pairs $$F',D'$$ (such that $$D'\subset F'\subset U'$$ and $$D', F', U' \in {{\mathcal {F}}}$$), so the maximum number of sets from $${{\mathcal {G}}}{\setminus } {{\mathcal {F}}}$$ containing the set $$D \in {{\mathcal {F}}}$$ is $$4 \times 9 = 36$$. As $${{\mathcal {F}}}$$ is $$\vee _5$$-free, there are at most 4 sets of $${{\mathcal {F}}}$$ containing D. So in total, D is contained in at most $$36+4 = 40$$ sets from $${{\mathcal {G}}}$$, a contradiction. $$\square$$

To finish the proof, observe that by Theorem 1.2, Claims 234 we have
\begin{aligned} |{{\mathcal {F}}}|+|{{\mathcal {F}}}_1|\le |{{\mathcal {F}}}\cup (\cup _{F\in {{\mathcal {F}}}_1}{{\mathcal {N}}}(F))|=|{{\mathcal {G}}}|\le (1+o(1))\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}
On the other hand, $$c(P_2,{{\mathcal {F}}})$$ is the number of edges (half the degree sum) in $$\overrightarrow{G}_{{\mathcal {F}}}$$ which is at most
\begin{aligned} \frac{1}{2}\big [4(|{{\mathcal {F}}}|-|{{\mathcal {F}}}_1|)+8|{{\mathcal {F}}}_1|\big ]=2(|{{\mathcal {F}}}|+|{{\mathcal {F}}}_1|)\le (2+o(1))\left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) . \end{aligned}
$$\square$$

## 5 Proof of Theorem 1.11

To get the upper bound, first we combine the method introduced in the previous section with some weighting of the sets. Let $${{\mathcal {F}}}\subseteq 2^{[n]}$$ be a $$\{\wedge _k,\vee _l,P_4\}$$-free family and let us define
\begin{aligned} {{\mathcal {F}}}_1:=\{F \in {{\mathcal {F}}}: (k-1)(l-1) < (l-1)d^+(F) + (k-1)d^-(F) \}. \end{aligned}
Note that for any $$F \in {{\mathcal {F}}}_1$$, we have $$d^+(F), d^-(F) \ge 1$$. Consider $$U_1,\ldots ,U_{d^-(F)} \in {{\mathcal {F}}}$$ with $$F \subseteq U_i$$ for $$1\le i \le d^-(F)$$, and $$D_1,\ldots ,D_{d^{+}(F)} \in {{\mathcal {F}}}$$ with $$D_j \subseteq F$$ for $$1 \le j \le d^{+}(F)$$. Let us define the following family
\begin{aligned} {{\mathcal {N}}}(F):=\{(U_i{\setminus } F)\cup D_j : 1\le i \le d^-(F), \ 1 \le j \le d^{+}(F)\}. \end{aligned}
By definition, we have $$|{{\mathcal {N}}}(F)|=d^-(F)d^{+}(F)$$ and $${{\mathcal {N}}}(F) \cap \{U_1,\ldots ,U_{d^-(F)},D_1,\ldots ,D_{d^{+}(F)}\}=\emptyset$$. We will prove several properties of the family $${{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$.

### Lemma 5.1

$${{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$ is $$\wedge _{k^2l^2}$$-free and $$\vee _{k^2l^2}$$-free.

### Proof

Note that every element $$G \in \cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)$$ has the form of $$(U {\setminus } F) \cup D$$ with some $$U,D \in {{\mathcal {F}}}$$ and $$F \in {{\mathcal {F}}}_1$$ such that $$D \subseteq F \subseteq U$$. If it is so, then we denote UD and F by U(G), D(G) and F(G) respectively. We also define $$U(G)=D(G)=F(G)=G$$ for every $$G \in {{\mathcal {F}}}{\setminus } (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$. We have the following

### Observation 1

Suppose we have two different $$G_1,G_2 \in {{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$ such that $$U(G_1)=U(G_2)$$ and $$D(G_1)=D(G_2)$$. Then $$F(G_1) \ne F(G_2)$$.

Now we start the proof of Lemma 5.1. We prove that $${{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$ is $$\vee _{k^2l^2}-$$free, the other case is similar.

We prove it by contradiction. Let us suppose that there are distinct sets $$G, G_1,\ldots ,G_{k^2l^2} \in {{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))$$ with $$G \subsetneq G_1,\ldots ,G_{k^2l^2}$$. Note that we can suppose without loss of generality that $$G \in {{\mathcal {F}}}$$ (if not, then we use $$D(G) \in {{\mathcal {F}}}$$ instead). As we can have at most $$l-1$$ different sets among $$U(G_1),\ldots ,U(G_{k^2l^2})$$ by the $$\vee _l$$-freeness of $${{\mathcal {F}}}$$, we have $$k^2l$$ many different $$G_i$$’s (we call them $$G'_1,\ldots ,G'_{k^2l}$$) with $$U(G'_1)=\ldots =U(G'_{k^2l}) \in {{\mathcal {F}}}$$. By the $$\wedge _k$$-freeness of $${{\mathcal {F}}}$$ there are at most k different sets among $$D(G'_1),\ldots ,D(G'_{k^2l})$$, which means we have kl different sets $$G'_i$$ (we call them $$G''_1,\ldots ,G''_{kl}$$) with $$D(G''_1)=\ldots =D(G''_{kl}) \in {{\mathcal {F}}}$$. But then by Observation 1, we have that $$F(G''_1),\ldots ,F(G''_{kl}) \in {{\mathcal {F}}}$$ are all different and all of them contain $$D(G''_1)$$, a contradiction and we are done with the proof of Lemma 5.1. $$\square$$

In the following lemma, we would like to bound the quantity $$|(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}|$$ from below. Note that it is possible that $${{\mathcal {N}}}(F) \cap {{\mathcal {N}}}(F') \ne \emptyset$$ for two distinct sets $$F,F' \in {{\mathcal {F}}}$$. However, we prove that it can not happen too many times in some “average sense”. Let us define an auxiliary bipartite graph $$G_1$$, where the two parts are $${{\mathcal {F}}}_1$$ and $$(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}$$, and the sets FH with $$F\in {{\mathcal {F}}}_1$$, $$H \in (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}$$, are connected by an edge if $$H \in {{\mathcal {N}}}(F)$$.

### Lemma 5.2

\begin{aligned} |{{\mathcal {F}}}_1|\le |(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}|. \end{aligned}

### Proof

We use the following simple claim which can be described as an “average version of Hall’s theorem”. We include its proof below for completeness. For a vertex x in a graph G, let N(x) denote the neighborhood of x in G. For a set S of vertices of G, let $$N(S) = \cup _{x \in S} N(x)$$.

### Claim 5

Let $$G=(A,B,E)$$ be a bipartite graph such that:
1. 1.

there is no isolated vertex in B, and

2. 2.
the degree of every vertex $$x\in B$$ is at least the average of the degrees in N(x), i.e.
\begin{aligned} d(x)\ge \frac{\sum _{y\in N(x)}d(y)}{d(x)}. \end{aligned}
Then there exists a matching in G that covers B, and in particular $$|B|\le |A|$$ holds.

### Proof

\begin{aligned} \frac{d(x)}{\sum _{y\in N(x)}\frac{1}{d(y)}}\le \frac{\sum _{y\in N(x)}d(y)}{d(x)}\le d(x), \end{aligned}
and thus
\begin{aligned} \sum _{y\in N(x)}\frac{1}{d(y)}\ge 1. \end{aligned}
Now for any $$B'\subseteq B$$ we sum $$\frac{1}{d(y)}$$ over all edges (xy) with $$x\in B', y\in N(B')$$, and we obtain
\begin{aligned} |B'|=\sum _{x\in B'}1\le \sum _{x\in B'}\sum _{y\in N(x)}\frac{1}{d(y)}\le \sum _{y\in N(B')}\sum _{x\in N(y)}\frac{1}{d(y)}=\sum _{y\in N(B')}1=|N(B')|. \end{aligned}
As G satisfies Hall’s condition, G indeed contains a matching that covers B.$$\square$$

The following claims show that the conditions of Claim 5 are satisfied for $$G_1$$.

### Claim 6

Condition 1 of Claim 5 holds for $$G_1$$ with $$A:=(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}$$ and $$B:={{\mathcal {F}}}_1$$.

### Proof

Pick $$F\in {{\mathcal {F}}}_1 = B$$. We want to show that F is adjacent to some set in $$A:=(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}$$. By the definition of $${{\mathcal {F}}}_1$$, we know that $$d^+(F), d^-(F) \ge 1$$, and we cannot have both $$d^+(F) < (k-1)/2$$ and $$d^-(F) < (l-1)/2$$. Without loss of generality, we can assume that $$d^+(F) \ge (k-1)/2$$ and let $$D_1,\ldots ,D_{d^{+}(F)} \in {{\mathcal {F}}}$$ be the sets contained in F. Then take a set $$U_1 \in {{\mathcal {F}}}$$ containing F, and consider the sets $$\{(U_1{\setminus } F)\cup D_j : 1 \le j \le d^{+}(F)\}$$. Suppose they are all in $${{\mathcal {F}}}$$. Then since they are contained in $$U_1$$ and are different from the sets $$D_1,\ldots ,D_{d^{+}(F)}, F$$, we get that $$U_1$$ contains at least $$2d^{+}(F)+1 \ge k$$ sets from $${{\mathcal {F}}}$$, contradicting the $$\Lambda _k$$-free property of $${{\mathcal {F}}}$$. Thus one of the sets $$S \in \{(U_1{\setminus } F)\cup D_j : 1 \le j \le d^{+}(F)\}$$ is not in $${{\mathcal {F}}}$$, so $$S \in (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}= A$$ and S is adjacent to F in the graph $$G_1$$, as desired. $$\square$$

Now we prove Condition 2 of Claim 5 and we note that we will use the $$P_4$$-freeness of $${{\mathcal {F}}}$$ only during the proof of the following claim.

### Claim 7

Condition 2 of Claim 5 holds for $$G_1$$ with $$A:=(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}$$ and $$B:={{\mathcal {F}}}_1$$.

### Proof

Pick any $$F\in {{\mathcal {F}}}_1$$ and let
\begin{aligned} a_i:= & {} |\{j: (U_i {\setminus } F) \cup D_j \in {{\mathcal {F}}}\}|, \text { and}\\ b_j:= & {} |\{i: (U_i {\setminus } F) \cup D_j \in {{\mathcal {F}}}\}|, \end{aligned}
where $$1 \le i \le d^-(F)$$ and $$1 \le j \le d^+(F)$$. We know that $$\sum _{i=1}^{d^-(F)} a_i = \sum _{j=1}^{d^+(F)} b_j$$, and let us denote this quantity by $$X=X_F$$. Observe that the degree of $$F \in {{\mathcal {F}}}_1$$ in the auxiliary bipartite graph $$G_1$$ is $$d^{-}(F)d^{+}(F) - X$$.

Pick the set $$(U_i {\setminus } F) \cup D_j$$ for some $$1 \le i \le d^-(F)$$ and $$1 \le j \le d^{+}(F)$$, and let us examine how many sets of $${{\mathcal {F}}}$$ can be contained in this set. Note that by Observation 1 the degree of $$(U_i {\setminus } F)\cup D_j$$ is at most $$|\{ S \in {{\mathcal {F}}}: S \subset (U_i {\setminus } F) \cup D_j \}|\cdot |\{ S \in {{\mathcal {F}}}: S \supset (U_i {\setminus } F) \cup D_j \}|$$.

Observe that as $$(U_i {\setminus } F) \cup D_j \subset U_i$$ we have
\begin{aligned}&|\{ S \in {{\mathcal {F}}}: S \subset (U_i {\setminus } F) \cup D_j \}| \\&\quad \le k-1-(d^+(F)+1)-a_i+1=k-1-d^+(F)-a_i. \end{aligned}
Indeed, the sets $$F, D_1,\ldots ,D_{d^{+}(F)}$$ are different from the $$a_i$$ sets of $${{\mathcal {F}}}$$ of the form $$(U_i {\setminus } F) \cup D_{j'}$$, and they are all contained in $$U_i$$. We also claim that these sets (apart from $$D_j$$) are not contained in $$(U_1{\setminus } F)\cup F_j$$. This is because $${{\mathcal {F}}}$$ is $$P_4$$-free, so in particular the $$D_{j'}$$’s form an antichain. Since at most $$k-1$$ sets can be contained in $$U_i$$, it follows that besides $$D_j$$, at most $$(k-1)-(d^{+}(F)+1)-a_i$$ other sets of $${{\mathcal {F}}}$$ can be contained in $$(U_i {\setminus } F) \cup D_j$$.
Similarly, we have
\begin{aligned}&|\{ S \in {{\mathcal {F}}}: (U_i {\setminus } F) \cup D_j \subset S \}| \\&\quad \le l-1-(d^-(F)+1)-b_j+1=l-1-d^-(F)-b_j. \end{aligned}
It suffices to prove the following:
\begin{aligned}&\sum _{1 \le i \le d^-(F), \ 1 \le j \le d^{+}(F)}(k-1-d^+(F)-a_i)(l-1-d^-(F)-b_j) \nonumber \\&\quad \le (d^{-}(F)d^{+}(F) - X)^2. \end{aligned}
(6)
Note that the left hand side of (6) is
\begin{aligned}&\left( \sum _{1 \le i \le d^-(F)}(k-1-d^+(F)-a_i)\right) \left( \sum _{1 \le j \le d^{+}(F)}(l-1-d^-(F)-b_j)\right) \\&\quad =\left( d^-(F)(k-1-d^+(F))-X\right) \left( d^+(F)(l-1-d^-(F))-X\right) , \end{aligned}
so the desired inequality has the following form:
\begin{aligned}&(d^+(F)(l-1-d^-(F))-X)(d^-(F)(k-1-d^+(F))-X) \nonumber \\&\quad \le (d^{-}(F)d^{+}(F) - X)^2. \end{aligned}
(7)
After rearranging, (7) is equivalent to the following:
\begin{aligned}&X(4d^{+}(F)d^{-}(F)-(d^{-}(F)(k-1)+d^{+}(F)(l-1)))\nonumber \\&\quad \le d^{-}(F)d^{+}(F)(d^{-}(F)(k-1)+d^{+}(F)(l-1)-(l-1)(k-1)). \end{aligned}
(8)
Now we use the following inequalities, that are consequences of using the $$\wedge _k$$-freeness condition on $$D_j$$’s and $$\vee _l$$-freeness on $$U_i$$’s:
• $$\bullet _1$$$$X \le d^{-}(F)(k-1-d^{+}(F)),$$ and $$X \le d^{+}(F)(l-1-d^{-}(F)).$$

• $$\bullet _2$$ As a consequence, we have $$X\le \frac{d^{-}(F)(k-1-d^{+}(F))+d^{+}(F)(l-1-d^{-}(F))}{2}$$.

Plugging $$\bullet _2$$ into the left hand side of (8), it would be enough to prove:
\begin{aligned}&\frac{d^{-}(F)(k-1-d^{+}(F))+d^{+}(F)(l-1-d^{-}(F))}{2}(4d^{+}(F)d^{-}(F)\nonumber \\&\qquad -(d^{-}(F)(k-1)+d^{+}(F)(l-1)))\nonumber \\&\qquad \le d^{-}(F)d^{+}(F)(d^{-}(F)(k-1)+d^{+}(F)(l-1)-(l-1)(k-1)). \end{aligned}
(9)
If one multiplies (9) by $$\frac{2}{(d^{-}(F)d^{+}(F))^2}$$, and uses the notation $$\alpha :=\frac{k-1}{d^{+}(F)}$$ and $$\beta :=\frac{l-1}{d^{-}(F)}$$, then (9) becomes
\begin{aligned} (\alpha + \beta -2)(4- \alpha - \beta ) \le 2 (\alpha + \beta -\alpha \beta ), \end{aligned}
which is equivalent to
\begin{aligned} 0 \le (\alpha -2)^2 + (\beta -2)^2, \end{aligned}
and thus we are done with the proof of Claim 7. $$\square$$

This finishes the proof of Lemma 5.2. $$\square$$

Now observe that by Lemma 5.1 and Theorem 1.2, we have
\begin{aligned} |{{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))| \le (1 + o(1))\left( {\begin{array}{c}n\\ \left\lfloor {n/2}\right\rfloor \end{array}}\right) . \end{aligned}
(10)
Moreover, by Lemma 5.2, we have
\begin{aligned} |{{\mathcal {F}}}{\setminus } {{\mathcal {F}}}_1| + 2|{{\mathcal {F}}}_1|= & {} |{{\mathcal {F}}}| + |{{\mathcal {F}}}_1| \le |{{\mathcal {F}}}|+ |(\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F)) {\setminus } {{\mathcal {F}}}|\nonumber \\= & {} |{{\mathcal {F}}}\cup (\cup _{F \in {{\mathcal {F}}}_1} {{\mathcal {N}}}(F))|. \end{aligned}
(11)
Combining (10) and (11), we get
\begin{aligned} |{{\mathcal {F}}}{\setminus } {{\mathcal {F}}}_1| + 2|{{\mathcal {F}}}_1| \le (1 + o(1))\left( {\begin{array}{c}n\\ \left\lfloor {n/2}\right\rfloor \end{array}}\right) . \end{aligned}
Using this, we obtain the following upper bound on the number of containments in $${{\mathcal {F}}}$$:
\begin{aligned} c(P_2, {{\mathcal {F}}}) (k+l-2)= & {} \sum _{F \in {{\mathcal {F}}}} ((l-1)d^{+}(F)+(k-1)d^-(F))\\\le & {} (k-1)(l-1)|{{\mathcal {F}}}{\setminus } {{\mathcal {F}}}_1| + 2(k-1)(l-1)|{{\mathcal {F}}}_1| \\\le & {} ((k-1)(l-1)+o(1))\left( {\begin{array}{c}n\\ n/2\end{array}}\right) . \end{aligned}
This completes the proof of Theorem 1.11. $$\square$$

## References

1. 1.
Bukh, B.: Set families with a forbidden subposet. Electron. J. Combin. 16, R142-11p (2009)
2. 2.
Erdős, P.: On a lemma of Littlewood and Offord. Bull. Am. Math. Soc. 51(12), 898–902 (1945)
3. 3.
Gerbner, D., Keszegh, B., Patkós, B.: Generalized forbidden subposet problems. arXiv:1701.05030
4. 4.
Gerbner, D., Patkós, B.: $$l$$-chain profile vectors. SIAM J. Discr. Math. 22(1), 185–193 (2008)
5. 5.
Graham, R.L., Sloane, N.J.A.: Lower bounds for constant weight codes. IEEE Trans. Inf. Theory 26, 37–43 (1980)
6. 6.
Katona, G.O.H.: Two applications of Sperner type theorems (for search theory and truth functions). Period. Math. Hungar. 3, 19–26 (1973)
7. 7.
Katona, G.O.H., Tarján, T.: Extremal Problems with Excluded Subgraphs in the $$n$$-cube, Graph Theory, Lagow, 1981. Lecture Notes in Mathematics, vol. 1018, pp. 84–93. Springer, Berlin (1983)Google Scholar
8. 8.
Patkós, B.: The distance of $${\cal{F}}$$-free hypergraphs. Stud. Sci. Math. Hungar. 46(2), 275–286 (2009)
9. 9.
Sperner, E.: Ein Satz über Untermengen einer endlichen Menge. Math. Z. 27(1), 544–548 (1928)

## Authors and Affiliations

• Dániel Gerbner
• 1
Email author
• Abhishek Methuku
• 2
• Dániel T. Nagy
• 1
• Balázs Patkós
• 1
• Máté Vizer
• 1
1. 1.Alfréd Rényi Institute of MathematicsHungarian Academy of SciencesBudapestHungary
2. 2.École Polytechnique Fédérale de LausanneLausanneSwitzerland