On the number of containments in $P$-free families

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 possible 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}\binom{l_{i-1}}{l_i})$, 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]}$.


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 [9] which states that if F is a family of subsets of [n] = {1, 2 . . . , n} (we write F ⊆ 2 [n] to denote this fact) such that no pair F, F ′ ∈ F of sets are in inclusion F F ′ , then F can contain at most n ⌊n/2⌋ sets. This is sharp as shown by [n] ⌊n/2⌋ (the family of all k-element subsets of a set X is denoted by X k and is called the k th layer of X). This was later generalized by Erdős [2], who showed that if F ⊆ 2 [n] does not contain a chain of length k + 1 (i.e. nested sets F 1 F 2 · · · F k+1 ), then the size of F is at most k i=1 n ⌊ n−k 2 ⌋+i , the sum of the k largest binomial coefficients of order n.
If P is a poset, we denote by ≤ P the partial order on the elements of P . Generalizing Sperner's result, Katona and Tarján [7] introduced the problem of determining the maximum size of a family F ⊆ 2 [n] that does not contain sets satisfying some inclusion patterns. Definition 1.1. Let P be a finite poset and F ⊆ 2 [n] . A subfamily G ⊆ F is a (weak) copy of P if there exists a bijection φ : P → G such that we have φ(x) ⊆ φ(y) whenever x ≤ P y holds.
Let F ⊆ 2 [n] and let P be a set of posets. We say that F is P-free, if F does not contain a copy of P for any P ∈ P. Generally, the area of forbidden subposet problems is concerned with determining the quantity La(n, P) := max{|F | : F ⊆ 2 [n] , F is P-free}.
If P = {P } we simply denote the quantity above by La(n, P ). 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 ) = k i=1 n ⌊ n−k 2 ⌋+i . The value of La(n, P ) 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 ∧ r denote the poset on r + 1 elements a, b 1 , b 2 , . . . , b r where a > b i for all 1 ≤ i ≤ r. Let ∨ r denote the poset on r + 1 elements a, b 1 , b 2 , . . . , b r where a < b i for all 1 ≤ i ≤ r. Katona and Tarján [7] proved that La(n, {∧ 2 , ∨ 2 }) = 2 n−1 ⌊ n−1 2 ⌋ . They also showed the following. Theorem 1.2 (Katona, Tarján [7]). For any positive integer r ≥ 2, we have La(n, ∨ r ) = La(n, ∧ r ) = n ⌊n/2⌋ 1 + O 1 n .
The Hasse diagram (also known as the cover graph) of a poset P is a graph with vertex set P where p, q ∈ P are joined by an edge if p ≤ P q and there does not exist r = p, q with p ≤ P r ≤ P q. A poset is called a tree poset if its Hasse diagram is a tree. Bukh [1] 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)) n ⌊ n 2 ⌋ . Recently Gerbner, Keszegh and Patkós [3] initiated the investigation of counting the maximum number of copies of a poset in a family F ⊆ 2 [n] that is P-free. More formally they introduced the following quantity: Let F ⊆ 2 [n] and P be a poset, then let c(P, F ) denote the number of copies of P in F . If either Q = {Q} or P = {P }, then we simply write La(n, P, Q), La(n, P, Q), La(n, P, Q). Note that La(n, P) = La(n, P, P 1 ).
There are not many results in the literature where other posets are counted. Katona [6] determined the maximum number of 2-chains (copies of P 2 ) in a 2-Sperner (P 3 -free) family F ⊆ 2 [n] by showing La(n, P 3 , P 2 ) = n i 1 i 1 i 2 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 [8] and generalized by Gerbner and Patkós in [4], where they proved the following result. To state the theorem and for later purposes we will use the multinomial coefficient: Theorem 1.4. For any pair k > l ≥ 1 of integers we have La(n, P k , P l ) = max Moreover, if k = l +1, then the above maximum is attained when the integers i 1 , i 2 −i 1 , . . . , 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 (the length of the longest chain in P ). Theorem 1.5. (i) For any poset P of height at least 3, we have La(n, P, P 2 ) = Θ(La(n, P 3 , P 2 )).
(ii) For any connected poset P of height 2 with at least 3 elements, we have We believe that the upper bound in part (ii) of Theorem 1.5 can be improved by a factor of √ n and we propose the following conjecture. Conjecture 1.6. For any poset P of height 2, we have La(n, P, P 2 ) ≤ O n n ⌊n/2⌋ .
Remark. Note that Conjecture 1.6, if true, gives the best possible order of magnitude as the ⌊n/2⌋+1 is K 2,2 -free (where K 2,2 denotes the poset on 4 elements a, b, c, d with a, b ≤ c, d) and it has ⌈n/2⌉ n ⌊n/2⌋ containments. In fact, there are many other families that are K 2,2 -free which have Ω(n n ⌊n/2⌋ ) containments, as discussed below. Let A(n, 2δ, 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δ. Graham and Sloane [5] showed that A(n, 2δ, k) ≥ 1 q δ−1 n k where q is any prime power with q ≥ n. Let i be a fixed integer. Consider the family F consisting of all subsets of [n] of size ⌊n/2⌋, plus A(n, 2i, ⌊n/2⌋ + i) subsets of size ⌊n/2⌋ + i where the symmetric difference of any pair of distinct subsets is at least 2i. The number of containments in F is at least Moreover, in F , any two sets of size ⌊n/2⌋ + i intersect in at most ⌊n/2⌋ elements, thus 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 .
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 ∧ s in {∧ k , ∨ l }-free families (note that P 2 is the special case ∧ 1 ).
We conjecture that this lower bound is sharp. Conjecture 1.9. For any integers k, l, s with s ≤ k − 1 we have We can show that the above conjecture holds in the following cases.
Theorem 1.10. Conjecture 1.9 holds in the following cases: 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 Section 3). Theorem 1.11. For any integers k, l, s with s ≤ k − 1 we have, 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 F ⊂ 2 [n] , the undirected comparability graph G F , and the directed comparability graph − → G F corresponding to F , are graphs whose vertex sets are equal to F and whose edge sets are defined as follows: Two vertices F, F ′ ∈ F are connected by an edge/arc (i.e. directed edge) if and only if F and F ′ are in containment. In Remark. Note that the ∧ k -free property is equivalent to the fact that the out-degree d + (v) of every vertex v in − → G F is at most k − 1 and the ∨ l -free property is equivalent to the fact that The number of pairs of F in containment equals the number of edges in G F and the number of arcs in − → G F (that is the sum of the out-degrees). More generally, we have Structure of the paper. The rest of the paper is organized as follows. In Section 2, we prove Theorem 1.5 and Theorem 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 Section 3, we prove Theorem 1.8 by constructing a {∧ k , ∨ l }-free family with many copies of ∧ s . In Section 4, we illustrate our method by proving Theorem 1.10. Finally, in Section 5, we prove Theorem 1.11 by applying this method.

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 , . . . , a s are positive integers, then the complete multi-level poset K a 1 ,a 2 ,...,as has s i=1 a i elements p 1 1 , p 1 2 , . . . p 1 a 1 , . . . , p s 1 , p s 2 , . . . , p s as 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,...,|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 F consisting of |P | − 1 full levels and determine the value As claimed by Theorem 1.4, n i j i j i l is maximized when i l , i j − i l , and n − i j differ by at most 1. Furthermore, if i j / ∈ ((2/3 − ε)n, (2/3 + ε)n) or i l / ∈ ((1/3 − ε)n, (1/3 + ε)n), then n/3 ) = o(La(n, P 3 , P 2 )). So, if we consider the graph G with vertex set {i 1 , i 2 , . . . , i |P |−1 } where i s < i t are joined by an edge if and only if n it it is = Θ(La(n, P 3 , P 2 )), then G is triangle-free. Therefore the number of edges in G is at most ⌊ (|P |−1) 2 4 ⌋. This finishes the proof of part (i).
The lower bound of (ii) is given by the family F ∧,∨ constructed by Katona and Tarján [7]: Indeed, all the connected components of the comparability graph of Therefore to finish the proof it is enough to show La(n, K s,s , P 2 ) ≤ O s (n2 n ) for any given integer s. Let G ⊆ 2 [n] be a K s,s -free family and for any pair G, First let us consider those pairs G ⊂ G ′ for which M cannot be defined. This means that G is contained in at most s − 1 other sets of G and thus the number of such pairs is at most (s − 1)|G| = O s (2 n ).
Next, for a fixed M ∈ 2 [n] , let us consider the pairs G ⊂ G ′ with M = M(G, G ′ ) = G ′ . Note that since M is contained in s sets of G (and G is K s,s -free), M can contain at most s−1 sets from G. In particular, the number of pairs Finally, let us consider the pairs Summing over all sets M and adding the other types of pairs in containment we obtain which finishes the proof of the upper bound of (ii).
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 | ≥ 3, we have 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 F does not contain a chain of length |T |. Therefore, we can partition F into antichains We claim that for any 1 ≤ i < j ≤ m, we have n i,j ≤ |T | (|A i | + |A j |). Indeed, suppose otherwise, and consider the comparability graph G = G A i ∪A j . Then in G, there are at least |T | |V (G)| edges, so the average degree in G is at least 2 |T |. It is easy to find a subgraph G ′ of G with minimum degree at least |T |, and one can then embed T greedily into G ′ , giving an embedding of T into F , a contradiction.
Therefore, the number of 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 F into at most |P | antichains. We can choose k of them |P | k 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 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 F ⊆ 2 [n] is P -free, then in particular it is K-free, so we obtain La(n, P, P k ) ≤ 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 ≥ 2.
Let G ⊆ 2 [n] be a K-free family and consider a k-chain C consisting of the sets We will upper bound the number of k chains in each of the following 3 cases separately: M(C) is not defined at all, M(C) = G k and finally M(C) 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 G and thus the number of such k-chains is at most (s − 1) times the number of (k − 1)-chains. If l ≤ 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 ≤ 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 ∈ M. Note that G is K-free and M is contained in s sets of G, therefore M cannot contain K ′ in 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- Finally, let us now count the chains The total number of k-chains for which M(C) could be defined is then Proof. By Theorem 1.4, there are integers i 1 , . . . , 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 , . . . , i l−2 in 2 [i] . Therefore, M ∈( n i ) La(i, P l−1 , P l−2 ) is equal to the number of (l − 1)-chains consisting of sets of size i 1 , . . . , 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.
Using the above claim and (1), we obtain that the number of k-chains for which M(C) could be defined is n i=0 O(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(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,...,s be the complete l-level poset with s > k − l + 1. Let i 1 , i 2 , . . . , i l−1 be integers such that n − (k − l + 1) − i 1 , i 1 − i 2 , . . . , i l−2 − i l−1 , i l−1 differ by at most 1. By Theorem 1.4, we know that the family are contained in the same newly added sets, then the resulting family will be K-free. If we add the sets and denote the resulting family by G, then we have c(G, P k ) = c(G ′ , P l−1 ) = La(n − (k − l + 1), P l , P l−1 ) = Ω k,l (La(n, P l , P l−1 )).
This finishes the proof.
First we show that F n,k,l is {∧ k , ∨ l }-free. As sets in F n,k,l are of size ⌊n/2⌋ and ⌊n/2⌋ + 1, if F ⊂ G holds for some F, G ∈ F n,k,l , then we have F ∈ ∪ m j=1 F − n,k,l,j , G ∈ ∪ m j=1 F + n,k,l,j . Let j(F ) and j(G) be the indices with F ∈ F − n,k,l,j(F ) , G ∈ 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 ⊂ G implies |F ∩ A j(G) )| ≤ 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 ) and thus )|, so G contains those sets of F n,k,l that are of the form G \ {a} with a ∈ G ∩ A j(G) . By definition of F + n,k,l,j there are k − 1 such a's. Similarly, any F is contained in those sets of F n,k,l that are of the form Therefore it remains to show that F + n,k,l := ∪ m j=1 F + n,k,l,j has size ( l−1 k+l−2 + o(1)) n ⌊n/2⌋+1 . To do this, let us introduce Let us bound |F + n,k,l,j | from below: given Clearly, F + n,k,l,j is the union of F H 's over all H satisfying the required intersection property. Also, we have Observe that 0 ≤ |H| ≤ j(k + l − 3). So j ≤ log n implies that for any ε > 0 and H with the above property if n is large enough, then we have As the number of sets H possessing the required intersection property is (p 2 2 k+l−3 ) j−1 p 1 2 k+l−3 , we obtain This finishes the proof as 4 Overview of our method and Proof of Theorem 1.10

Proof of Theorem 1.10 (i) and a lemma
Proof of Theorem 1.10 (i). Let F ⊆ 2 [n] be a {∧ k , ∨ l }-free family and let us consider − → G F , its directed comparability graph. Let A denote the set of vertices with out-degree k − 1. As F is ∧ k -free, this is the maximum out-degree and c(∧ k−1 , F ) = |A|. Observe that d − (a) = 0 for any a ∈ A, as if (b, a) ∈ E( − → G F ) (i.e., there is a directed edge from b to a), then d + (b) ≥ k would hold (every out-neighbor of a would be an out-neighbor of b in addition to a) contradicting the ∧ k -free property of F . This implies that A is an independent set in − → G F and there is no edge As F is ∨ 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

Rearranging gives
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 Below we show that if the construction F n,k,l (defined in Section 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 k, l we have Let P be a poset on two levels not containing ∧ k and ∨ 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 {∧ k , ∨ l }-free family F ⊂ 2 [n] is asymptotically maximized by the construction F n,k,l .
Proof. We already showed that every set v ∈ F + n,k,l has d + (v) = k − 1 and every set v ∈ F − n,k,l has d − (v) = l − 1. (Actually, 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 {∧ k , ∨ l }-free family F ⊂ 2 [n] . First, pick an edge of the Hasse diagram of P and embed its endpoints to two sets of F . We have as many possibilities as the number of containments among sets in F . By Theorem 1.8 and our assumption, this is asymptotically maximized by F = F n,k,l .
We continue the embedding of the points of P as follows. We pick a point p ∈ 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 F = F n,k,l . Moreover, if F = F n,k,l we will not get stuck during the embedding when trying to embed a point p ∈ P into a set F ∈ F that is already used, because the comparability graph of F n,k,l has no cycle shorter than 6 edges and the Hasse diagram of P contains no 6-edge path.
We can use the above lemma in the case P = ∧ s (s ≤ k − 1) to obtain the following: Corollary 4.2. If for some fixed integers k, l we have By Corollary 4.2, notice that in order to prove part (ii) of Theorem 1.10, it suffices to prove that La(n, {∧ k , ∨ l }, P 2 ) = (k−1)(l−1) n ⌊n/2⌋ for k, l ≤ 5. We will prove this in the next subsection, by introducing a new method.

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 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 F be a {∧ 4 , ∨ 4 }-free family of subsets of [n]. Let G F be the comparability graph corresponding to F (see Notation 1.13). Let K be the set consisting of the vertex sets of all (maximal) connected components of G F . Clearly, 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 ∈ K, the elements v 1 ∈ C 1 and v 2 ∈ C 2 are unrelated. For each connected component of G F with vertex set C ∈ K, let G C be the subgraph of G F induced by C. Then the number of containments in F is Suppose that for each connected component C ∈ K, the following inequality holds.
Then by (3) and (4) we would get that c(P 2 , F ) ≤ 3 2 |F |, and by Theorem 1.2 we are done. But this is not necessarily true: Consider the connected component S with elements a, b, c, d, e where a, b < v < d, e. Then G S has 8 edges but |S| = 5, so (5) does not hold. In fact, we claim that if there is a connected component in G F for which (5) does not hold, then it must be isomorphic to G S . Indeed, notice that for a connected component C, 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 more than or less than 4 elements in C since F is {∧ 4 , ∨ 4 }-free. Moreover, it is also impossible that v is more than 3 elements a, b, c and less than an element d, since then d is above 4 elements of C, a contradiction. Similarly, it is impossible that v is less than 3 elements and more than an element of C. Therefore, the only possibility is that v is more than exactly 2 elements a, b and less than exactly 2 elements d, e. Moreover, it is easy to check that in this case, the elements a, b, c, d 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 F to produce a new family G: Consider each subfamily We claim that each newly added set F i ∈ S ′ i is unrelated to all the other sets L ∈ G \ S ′ i . Indeed, if L ∈ G \ F -i.e., say L = F j for some j = 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 F . If L ∈ 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 G corresponding to G are the same as those of G F except that the components isomorphic to G S in G F are replaced by G S ′ . Therefore, any set of G is related to at most one of the newly added sets F i . So G is {∧ 5 , ∨ 5 }-free.
Let K ′ be the set consisting of the vertex sets of connected components of G G . For each connected component C ∈ K ′ ∩ K the inequality (5) holds. As we already noted, for each connected component C ∈ K ′ \ K, G C is isomorphic to G S ′ . Moreover, since |S ′ | = 6 and |E(G S )| = 8, we have |E(G S )| ≤ 3 2 |S ′ |. Therefore, by (4), On the other hand, |G| = n ⌊n/2⌋ (1 + O( 1 n )) by Theorem 1.2 since G is {∧ 5 , ∨ 5 }-free. Combining this with the above inequality, the proof is complete.
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 {∧ 5 , ∨ 5 }-free family F and its comparability graphs G F and − → G F . Recall that, for any F ∈ F , d(F ) denotes the degree of F in G F and d + (F ), d − (F ) denote the out degree and in degree of F in − → G F respectively. We want to show the number of edges in G F is at most (2 + O(1/n)) n n/2 . (Then we would be done by applying Corollary 4.2.) Equivalently, we would like to show that F ∈F d(F ) = F ∈F (d + (F ) + d − (F )) is at most (4 + O(1/n)) n n/2 . We say that a set F ∈ F is problematic if d(F ) ≥ 5. As F is {∧ 5 , ∨ 5 }-free, trivially, we have d(F ) ≤ 8 for any F ∈ 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 ∨ 5 -free property of F ). By a symmetric argument, we can conclude that F contains at most 3 sets, implying d(F ) ≤ 6. (Similar reasoning shows that if F is {∧ k , ∨ l }-free, then d(F ) ≤ k − 2 + l − 2 holds.) Let F 1 denote the family of problematic sets. As noted before, for any F ∈ F 1 we have 1 ≤ d + (F ), d − (F ) ≤ 3 and consider U 1 , ..., Let us define the following family As the U i 's are distinct supersets of F and the D j 's are dstinct subsets of F we obtain that Proof. For any F ∈ F 1 we have max{d . Suppose d − (F ) ≥ 3 (the case when d + (F ) ≥ 3 is similar) and with the above notation let us consider the sets (U i \ F ) ∪ D 1 (i = 1, 2, 3). They are all distinct and do not contain F . If they all belong to F , then D 1 is contained in at least 7 sets contradicting the ∨ 5 -free property of F .
Case I: F, F ′ are in containment, say F F ′ . In this case the component of F, Observe that every set in N (F ) contains an element in F ′ \ 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 ∈ F and U ′ 1 , U ′ 2 ∈ F contain F and F ′ respectively and let D 1 ,  Proof. Suppose not, and let D, U 1 , U 2 , . . . , U 41 be a copy of ∨ 41 in G. (The ∧ 41 case is similar.) We can assume that D ∈ F as every set G ∈ G contains a set (maybe itself) from F . Observe that if D is contained in G ∈ G, then G has the form of In particular D ⊂ U ′ , and as F is ∨ 5 -free there is at most 4 choices of U ′ . Because of the ∧ 5 -free property, for each such U ′ , there exist at most 3 × 3 = 9 pairs F ′ , D ′ (such that D ′ ⊂ F ′ ⊂ U ′ and D ′ , F ′ , U ′ ∈ F ), so the maximum number of sets from G \ F containing the set D ∈ F is 4 × 9 = 36. As F is ∨ 5 -free, there are at most 4 sets of F containing D. So in total, D is contained in at most 36 + 4 = 40 sets from G, a contradiction.
To finish the proof observe that by Theorem 1.2, Claims 4.3, 4.4, 4.5 we have On the other hand, c(P 2 , F ) is the number of edges (half the degree sum) in (1)) n ⌊n/2⌋ .

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 F ⊆ 2 [n] be a {∧ k , ∨ l , P 4 }-free family and let us define Note that for any F ∈ F 1 we have d Let us define the following family We will prove several properties of the family F ∪ (∪ F ∈F 1 N (F )).
Proof. Note that every element G ∈ ∪ F ∈F 1 N (F ) has the form of (U \ F ) ∪D with some U, D ∈ F and F ∈ F 1 such that D ⊆ F ⊆ U. If it is so, then we denote U, D and F by U(G), D(G) and F (G) respectively. We also define U(G) = D(G) = F (G) = G for every G ∈ F \ (∪ F ∈F 1 N (F )).
We have the following Now we start the proof of Lemma 5.1. We prove that F ∪ (∪ F ∈F 1 N (F )) is ∨ k 2 l 2 −free, the other case is similar.
We prove it by contradiction. Let us suppose that there are distinct sets G, G 1 , . . . , G k 2 l 2 ∈ F ∪ (∪ F ∈F 1 N (F )) with G G 1 , . . . , G k 2 l 2 . Note that we can suppose without loss of generality that G ∈ F (if not, then we use D(G) ∈ F instead). As we can have at most l − 1 different sets among U(G 1 ), . . . , U(G k 2 l 2 ) by the ∨ l -freeness of F , we have k 2 l many different G i 's (we call them G ′ 1 , . . . , G ′ k 2 l ) with U(G ′ 1 ) = . . . = U(G ′ k 2 l ) ∈ F . By the ∧ k -freeness of F there are at most k different sets among D(G ′ 1 ), . . . , D(G ′ k 2 l ), which means we have kl different sets G ′ i (we call them G ′′ 1 , . . . , G ′′ kl ) with D(G ′′ 1 ) = . . . = D(G ′′ kl ) ∈ F . But then by Observation 5.2, we have that F (G ′′ 1 ), . . . , F (G ′′ kl ) ∈ 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.
In the following lemma, we would like to bound the quantity |(∪ F ∈F 1 N (F )) \ F | from below. Note that it is possible that N (F ) ∩ N (F ′ ) = ∅ for two distinct sets F, F ′ ∈ 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 F 1 and (∪ F ∈F 1 N (F )) \ F , and the sets F, H with F ∈ F 1 , H ∈ (∪ F ∈F 1 N (F )) \ F , are connected by an edge if H ∈ N (F ).
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) = ∪ x∈S N(x).
Then there exists a matching in G that covers B, and in particular |B| ≤ |A| holds. Proof.
and thus Now for any B ′ ⊆ B we sum 1 d(y) over all edges (xy) with x ∈ B ′ , y ∈ N(B ′ ), and we obtain As G satisfies Hall's condition, G indeed contains a matching that covers B.
The following claims show that the conditions of Claim 5.4 are satisfied for G 1 . Proof. Pick F ∈ F 1 = B. We want to show that F is adjacent to some set in A := (∪ F ∈F 1 N (F ))\ F . By the definition of F 1 , we know that d + (F ), d − (F ) ≥ 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 ) ≥ (k−1)/2 and let D 1 , ..., D d + (F ) ∈ F be the sets contained in F . Then take a set U 1 ∈ F containing F , and consider the sets Suppose they are all in F . Then since they are contained in U 1 and are different from the sets D 1 , . . . , D d + (F ) , F , we get that U 1 contains at least 2d + (F ) + 1 ≥ k sets from F , contradicting the Λ k -free property of F . Thus one of the Now we prove Condition 2. of Claim 5.4 and we note that we will use the P 4 -freeness of F only during the proof of the following claim. Proof. Pick any F ∈ F 1 and let a i := |{j : (U i \ F ) ∪ D j ∈ F }|, and b j := |{i : (U i \ F ) ∪ D j ∈ F }|, where 1 ≤ i ≤ d − (F ) and 1 ≤ j ≤ d + (F ). We know that d − (F ) i=1 a i = d + (F ) j=1 b j , and let us denote this quantity by X = X F . Observe that the degree of F ∈ F 1 in the auxiliary bipartite graph G 1 is d − (F )d + (F ) − X.
Pick the set (U i \ F ) ∪ D j for some 1 ≤ i ≤ d − (F ) and 1 ≤ j ≤ d + (F ), and let us examine how many sets of F can be contained in this set. Note that by Observation 5.2 the degree of (U i \ F ) ∪ D j is at most |{S ∈ F : S ⊂ (U i \ F ) ∪ D j }| · |{S ∈ F : S ⊃ (U i \ F ) ∪ D j }|.
Observe that as (U i \ F ) ∪ D j ⊂ U i we have Indeed, the sets F, D 1 , . . . , D d + (F ) are different from the a i sets of F of the form (U i \ F ) ∪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 \F )∪F j . This is because 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 F can be contained in (U i \ F ) ∪ D j .
Similarly, we have It suffices to prove the following: Note that the left hand side of (6) is so the desired inequality has the following form: After rearranging, (7) is equivalent to the following: Now we use the following inequalities, that are consequences of using the ∧ k -freeness condition on D j 's and ∨ l -freeness on U i 's: , and X ≤ d + (F )(l − 1 − d − (F )).
Using this, we obtain the following upper bound on the number of containments in F : This completes the proof of Theorem 1.11.