On the Maximum $F_5$-free Subhypergraphs of a Random Hypergraph

Denote by $F_5$ the $3$-uniform hypergraph on vertex set $\{1,2,3,4,5\}$ with hyperedges $\{123,124,345\}$. Balogh, Butterfield, Hu, and Lenz proved that if $p>K \log n / n$ for some large constant $K$, then every maximum $F_5$-free subhypergraph of $G^3(n,p)$ is tripartite with high probability, and showed that if $p_0 = 0.1\sqrt{\log n} / n$, then with high probability there exists a maximum $F_5$-free subhypergraph of $G^3(n,p_0)$ that is not tripartite. In this paper, we sharpen the upper bound to be best possible up to a constant factor. We prove that if $p>C \sqrt{\log n} / n $ for some large constant $C$, then every maximum $F_5$-free subhypergraph of $G^3(n, p)$ is tripartite with high probability.


Introduction
In this paper, a (hyper)graph is maximum with respect to a property if it has the maximum number of (hyper)edges among the (hyper)graphs satisfying the given property.Throughout the paper, all logarithms are in base e.
One of the first results in extremal graph theory is Mantel's Theorem [9], which states that every triangle-free graph on n vertices has at most ⌊n 2 /4⌋ edges.Additionally, the complete bipartite graph whose part sizes differ by at most one is the unique maximum triangle-free graph.Later, Turán [13] generalized Mantel's Theorem for all complete graphs.Denote by K s the complete graph on s vertices and by T s (n) the complete s-partite graph on n vertices where the sizes of the parts differ by at most 1.Turán's Theorem states that T s−1 (n) is the unique maximum K s -free graph on n vertices.Turán's Theorem can also be understood as a property of K n .Namely, it claims that every maximum K s -free subgraph of K n is (s − 1)-partite.
Let G(n, p) be the standard binomial model of random graphs, where each edge in K n is chosen independently with probability p.We say that an event occurs with high probability (w.h.p.) if its probability goes to 1 as n goes to infinity.A question related to Turán's Theorem arises when G(n, p) replaces the role of K n , that is, for what p = p(n) we have that w.h.p. every maximum K s -free subgraph of G(n, p) is (s − 1)-partite.
This question was first raised by Babai, Simonovits, and Spencer [1], who gave an affirmative answer when p = 1  2 and s = 3.Later, DeMarco and Kahn [6] determined the correct order of p for s = 3.They [6] showed that if p > K log n/n for some large constant K, then w.h.p. every maximum triangle-free subgraph of G(n, p) is bipartite, while if p = 0.1 log n/n, then this does not hold w.h.p.Finally, DeMarco and Kahn [7] answered this question up to a constant factor for every s 3. Similar problems were also considered for hypergraphs.Denote by K − 4 the hypergraph obtained from the complete 3-uniform hypergraph on four vertices by removing one hyperedge.Let F 5 , which is often called the generalized triangle, be the hypergraph on vertex set {1, 2, 3, 4, 5} with hyperedges {123, 124, 345}.Denote by S(n) the complete 3-partite 3uniform hypergraph on n vertices whose parts have sizes ⌊n/3⌋, ⌊(n + 1)/3⌋, and ⌊(n + 2)/3⌋, and let s(n) := ⌊n/3⌋ • ⌊(n + 1)/3⌋ • ⌊(n + 2)/3⌋ be the number of hyperedges in S(n).Bollobás [4] proved that S(n) is the unique maximum {K − 4 , F 5 }-free n-vertex hypergraph.Frankl and Füredi [8] proved that, for n 3000, the maximum number of hyperedges in an n-vertex The random version of this theorem was first studied by Balogh, Butterfield, Hu, and Lenz [2].Let G 3 (n, p) be the random 3-uniform hypergraph on vertex set [n] := {1, 2, . . ., n}, where each triple is included with probability p independently of each other.Note that when p is very small, G 3 (n, p) itself is tripartite and hence F 5 -free w.h.p.Therefore, the interesting case is when p is sufficiently large.In [2], it was proved that if p > K log n/n for some large constant K, then w.h.p. every maximum F 5 -free subhypergraph of G 3 (n, p) is tripartite, and it was conjectured that it suffices to require only p > C √ log n/n for some large constant C. In this paper, we verify this conjecture.This is best possible up to the constant factor, as it was also shown in [2] that when p = 0.1 √ log n/n, then w.h.p. there is a maximum F 5 -free subhypergraph of G 3 (n, p) that is not tripartite.Theorem 1.There exists a constant C > 0 such that if p > C √ log n/n, then w.h.p. every maximum F 5 -free subhypergraph of G 3 (n, p) is tripartite.
Our approach will follow the general structure of the proof of the main result of [2].Several key lemmas are improved and adapted for this smaller p.In particular, in [2], an easier version of codegree concentration was proved using Chernoff's bound with the larger p.Here, for the smaller p, we need a stronger statement, not only using Chernoff's bound (cf.Lemmas 6 and 8).As typical with the probabilistic method, one must fight to avoid applying the union bound when the concentration is not strong enough.This is the most challenging and technical part of the proof, see Remarks 7 and 19 for more details on that.We trust that the new ideas used in the proof could be useful for other problems when one has to beat the union bound.
The rest of the paper is structured as follows.In Section 2, we will introduce the notation and lemmas needed.In Section 3, we give the proof of Theorem 1.

Preliminaries
To improve readability, as it is standard in the literature, we will usually pretend that large numbers are integers to avoid using essentially irrelevant floor and ceiling symbols.We often use the standard upper bound n k ( en k ) k for binomial coefficients.We will use xy to stand for set {x, y} and xyz to stand for set {x, y, z}.We write x = (1 ± c)y for (1 − c)y x (1 + c)y.
We use G for G 3 (n, p) hereinafter and denote by t(G) the number of hyperedges in a maximum tripartite subhypergraph of G.
We will always assume that the hypergraphs are on vertex set [n] = {1, . . ., n}, so we can identify a hypergraph H by its hyperedges, and |H| stands for the number of hyperedges of H.We use π = (V 1 , V 2 , V 3 ) for a 3-partition of [n].We say a 3-partition π is balanced if every part has size (1 ± 10 −10 )n/3.Denote by K π the set of triples with exactly one vertex in each part of π.
We will call hyperedges in H π the crossing hyperedges of H, and the hyperedges in Hπ the missing crossing hyperedges of H.
For a hypergraph H,

and subsets of vertices S, T ⊆ [n], let
• N H S,T (v) := {yz : y ∈ S, z ∈ T, vyz ∈ H} be the link graph of v between S and T , • d H S,T (v) := |N H S,T (v)| be the degree of v between S and T , • N H S (v, v ′ ) := {z : z ∈ S, vv ′ z ∈ H} be the set of neighbors of v and v ′ in S, )| be the codegree of v and v ′ in S, and ) be the common neighborhood of v and v ′ between S and T .
When S or T is [n] or H = G, we omit to write S, T , or G when there is no ambiguity.When S or T is V i , we often just use i in the subscript to stand for V i .For example, d(x) is just the degree of x in G and N H 1 (y, z) is the neighbors of y and The first proposition we need is the following result from [2], which is a special case of a general transference result of Conlon and Gowers [5], and as Samotij observed [10], of Schacht [12].It was also proved by the hypergraph container method [3,11].
Proposition 2. For every δ > 0, there exist ε > 0 and C > 0 such that if p > C/n, then the following statement is true.Let H be a maximum F 5 -free subhypergraph of G and π be a 3-partition of [n] maximizing |H π |.Then, we have that w.h.p. π is balanced, |H| (2/9 − ε)p n 3 , and |H \ H π | δpn 3 .The following concentration results are also used in [2].Lemma 3 is the standard Chernoff's bound.Lemmas 4 and 5 are standard properties of random hypergraphs, which are direct applications of Lemma 3 and the union bound.

Lemma 3. Let Y be the sum of mutually independent indicator random variables, and let
Lemma 4. For every ε > 0, there exists a positive constant C such that if p > C log n/n 2 , then w.h.p. for every vertex v, we have Lemma 5.For every ε > 0, there exists a positive constant C such that if p > C/n, then w.h.p. for every We also need the following concentration results.Lemma 6.There exists a positive constant C such that if p > C √ log n/n, then w.h.p. for every pair of vertices x, y, we have d(x, y) pn √ log n/ log log n.
Proof.For every pair of vertices xy, the probability that d(x, y) There are n 2 pairs of vertices, so by using a union bound, the probability that there exists a pair of vertices xy such that d(x, y) pn where the last expression is o(1) for sufficiently large C.
Remark 7. Lemma 6 shows one of the differences when p is only at least C √ log n/n, whereas in [2] it is proved that w.h.p. we have d(x, y) 2pn for every pair of vertices x, y when p > K log n/n.Note that with a direct application of Chernoff's inequality, one can only conclude that d(x, y) pn √ log n, without the log log n factor.As we will see in Section 3, this log log n factor plays a vital role in the proof of Theorem 1 (see Remark 19).Lemma 8.There exists a constant C > 0 such that if p > C √ log n/n, then w.h.p. for every subset S ⊆ [n], we have Proof.First, consider a fixed set S. For every pair of vertices xy ⊆ [n] \ S, the probability that d S (x, y) > 3pn is at most q = |S| 3pn p 3pn .For different pairs x 1 y 1 , x 2 y 2 ⊆ [n] \ S, random variables d S (x 1 , y 1 ) and d S (x 2 , y 2 ) are independent.Hence, given a family of n 2 e − √ log n pairs of vertices in [n] \ S, the probability that d S (x, y) 3pn for every pair in this family is at most q n 2 e − √ log n .Then, by a union bound over all the families containing pairs of vertices not in S with size n 2 e −c √ log n , we get Finally, using a union bound over all the choices of S, the probability of failure is at most In our proof of Theorem 1, we will repeatedly use the following lemma to show that for some given vertex v and vertex set S, the number of pairs that are in the link graph of v and have a large neighborhood in S is small.Let s = s(n, p), r = r(n, p), i = i(n, p) be positive integers depending on n and p, where s n, r

S
For fixed v and S, events vyz ∈ G, d S (y, z) i are independent for different pairs yz, so Then, using a union bound over all choices of v ∈ [n] and S ⊂ [n] of size s, we get that where Ēs,r,i is the complement of the event E s,r,i .Now we have  1 by the definition of E. If d E (x) 3, choose vxw 1 , vxw 2 , vxw 3 arbitrarily from E. For every yz ∈ T , there exists some i ∈ {1, 2, 3} such that y = w i and z = w i .Hence, by the definition of K(v, E, A, T ), we have [x, T ] ⊆ K(v, E, A, T ).If d E (x) 2, then by Lemma 6, we have that w.h.p.Now, we apply the union bound over all possible choices of (v, E, A, T ).We have at most n choices for v and at most n a choices for sets A with size a.With high probability we have that for every a, t > 0, given |A| = a and |T | = t, there are at most 2 apn √ log n log log n choices for E (by Lemma 6) and at most pn 2 t choices for T (by Lemma 4).By the union bound, the probability that the statement in the lemma does not hold is at most

Proof of the Main Theorem
We first give an outline of the proof.Recall that for a hypergraph H and a partition we defined in Section 2 that For every yz ∈ L 2,3 (x 1 , x 2 ) where y = v and z = v, at least one hyperedge from {yzx 1 , yzx 2 } cannot be in H, since otherwise hyperedges {yzx 1 , yzx 2 , x 1 x 2 v} form a copy of F 5 .For those Hence, the existence of e will cause H to lose Ω(log n) hyperedges.Since H is maximum, one can expect that H should not contain such hyperedges with more than one vertex in any part of π, so H is tripartite.Proposition 12 confirms this idea.We also need to handle Q(π).A control over |Q(π)| will be given by Proposition 13, which states that if Q(π) is large, then t(G) will be much larger than |G π |.Theorem 1 will be a simple corollary of Propositions 12 and 13.
For a 3-uniform hypergraph H, the shadow graph of H is the graph on the same vertex set, where xy is an edge if and only if there exists another vertex z such that xyz is a hyperedge in H.

Proposition 12. Let H be an F 5 -free subhypergraph of G and π
where equality is possible only if Based on Propositions 12 and 13, Theorem 1 easily follows, whose proof is similar to the proof of the main theorem in [2].
Hence, H ′ satisfies the assumptions in Proposition 12. Now, we have w.h.p.
Here we use Proposition 12 for (1), Lemma 6 for (2), the assumption p > C √ log n/n for (3), and Proposition 13 for (4).|H| cannot be strictly smaller than t(G), so all the inequalities must hold with equality.By Propositions 12 and 13, H ′ is tripartite and Q(π) is empty.Then, we conclude that H = H ′ is tripartite.
The proof of Proposition 13 is exactly the same as the one in [2], where it is assumed that p > K log n/n.It can be easily checked that all the arguments still work verbatim with p > C √ log n/n, and hence we do not include its proof here.It remains to prove Proposition 12.
Clearly, we can assume that Let δ be small enough so that the following arguments work, and fix three small positive constants ε 1 , ε 2 , and ε 3 such that For example, we can set Denote by J the induced subgraph of the shadow graph of H 1 on the vertex set V 1 and use N J (x), d J (x) for neighborhood and degree of x in graph J, respectively.Call a 4-set {w 1 , w 2 , y, z} an F5 if w 1 yz, w 2 yz ∈ G π and there exists e ∈ H such that w 1 , w 2 ∈ e ∩ V 1 , y, z / ∈ e.Note that w 1 w 2 ∈ J and {w 1 yz, w 2 yz, e} forms a copy of F 5 in G, so at least one of w 1 yz and w 2 yz has to be in Hπ .
Figure 5: The set {w 1 , w 2 , y, z} is an F5 if there exists an edge e ∈ H 1 as below.
We next count copies of F5 to lower bound the number of missing crossing hyperedges | Hπ |, based on the size of (a subgraph of) J. First, we prove the following claim, which will be used in the proofs of the next few lemmas.
Proof.Since x 1 x 2 is in J, there exists v 0 such that x 1 x 2 v 0 ∈ H. Since x 1 x 2 is not in Q(π), there exist at least 0.8p 2 n 2 /9 choices of (y, z) such that y ∈ V 2 , z ∈ V 3 , and x 1 yz and x 2 yz are both in G π .By Lemma 6, we know that w.h.p. d(x 1 , v 0 ) is at most pn √ log n log log n , so there can be at most pn Therefore, there are at least 0.8p 2 n 2 /9 − pn √ log n log log n p 2 n 2 /12 choices of (y, z) such that x 1 yz, x 2 yz ∈ G π and v 0 ∈ {y, z}.
Lemma 15.Suppose the assumptions of Proposition 12 hold.Let J ′ be a subgraph of J and denote by ∆(J ′ ) the maximum degree of J ′ .If ∆(J ′ ) ε 1 n, then w.h.p. we have Proof.For each wx ∈ J ′ , we get wx / ∈ Q(π) by the assumption of Proposition 12, so there are at least p 2 n 2 /12 choices of (y, z) such that {w, x, y, z} spans an F5 , by Claim 14.Then there are at least Otherwise, call xyz good.We will show that the number of copies of F5 that contain a good hyperedge from Hπ is at least 1   4   x∈V 1 d J ′ (x) p 2 n 2 12 .For x ∈ V 1 , let n x be the number of copies of F5 that contain vertex x and a bad hyperedge e ∈ Hπ such that x ∈ e, and let r x be the number of (y, z) such that y ∈ V 2 , z ∈ V 3 , and xyz is bad.We will repeatedly use Lemma 9 for some choices of (s, r, i) ∈ O to give upper bounds for r x and then obtain upper bounds for n x .For every x ∈ V 1 , we consider the following two cases.
Case 1: Case 2: Recall that a copy of F5 contains at least one hyperedge from Hπ , which is either bad or good.Thus, the number of copies of F5 that contain a good hyperedge from Hπ is at least If ∆(J ′ ) ε 1 n, every good missing crossing hyperedge is in at most 3ε 1 pn copies of F5 estimated in (5), so If further ∆(J ′ ) ε 1 n/ √ log n, then every good missing crossing hyperedge is in at most pn log log n 500 √ log n copies of F5 estimated in (5), so Now, we divide the rest of the proof into two cases according to the size of Hπ .The notations and calculations are similar in both cases.Proof.For each wx ∈ J, we get wx / ∈ Q(π) by the assumption of Proposition 12, so there are at least p 2 n 2 /12 choices of (y, z) such that {w, x, y, z} spans an F5 , by Claim 14.Then there are at least 1 12 |J|p 2 n 2 copies of F5 in total.On the other hand, at least one of wyz and xyz must be in Hπ .For xyz where d V 1 (y, z) 3pn, xyz can be in at most 3pn copies of F5 .Hence the number of copies of F5 containing a pair (y, z) ∈ V 2 × V 3 with d V 1 (y, z) 3pn is at most 3| Hπ |pn.By Lemma 8, there can be at most n 2 e − √ log n pairs (y, z) with d V 1 (y, z) 3pn, Finally, we deduce Proposition 12 assuming | Hπ | δpn 3 / log n.

| Hπ
Proof of Proposition 12.We will show that with high probability | Hπ | 3|H 1 |, by using the lower bounds in Lemmas 15, 17, and 18. Partition H 1 into the following three sets.
There are three cases needed to be handled.
For every vertex x ∈ S 1 , there are at most 2pn 2 hyperedges in H √ log n from Lemma 15, which we can only obtain when ∆(J ′ ) ε 1 n/ log 1/2+c n for some constant c > 0.Then, we would need to modify the definition of S to be {x ∈ V 1 : d J (x) ε 1 n/ log 1/2+c n}.However, the assumption of Lemma 11 is no longer valid for sets A of smaller size.Therefore, we would not be able to use Lemma 11 in the proof of Lemma 17.

n 2 ,
and i n.Let E s,r,i be the event that for every vertex v ∈ [n] and vertex set S ⊆ [n], where v / ∈ S and |S| = s, we have |{yz ⊆ [n] \ S : vyz ∈ G, d S (y, z) i}| r, see Figure 3. Define g(p, s, r, i) := n n s n 2 r p s i p i r , and let O be the set of (s, r, i) such that g(p, s, r, i) = o(n −5 ) given p > C √ log n/n.Let E be the event (s,r,i)∈O E s,r,i .Lemma 9. E happens with high probability.Proof.For distinct vertices v, y, z ∈ [n] and vertex set S ⊂ [n] where v, y, z / ∈ S and |S| = s, we have P(vyz ∈ G) = p and P(d S (y, z) i) s i p i .Note that these two events are independent since v / ∈ S. Hence, P(vyz ∈ G, d S (y, z) i) p s i p i .

Figure 3 :
Figure 3: A pair of vertices yz satisfies that vyz ∈ G and d S (y, z) i.The event E s,r,i is that for every vertex v and vertex set S ⊆ [n] \ {v} with size s, there are at most r such pairs of vertices.

Remark 10 .
Lemmas 8 and 9 are similar, and one may hope that we can still keep the e − √ log n factor, by proving (s, pn 2 e − √ log n , 3ps) ∈ O for every 1 s n.Unfortunately, this is not necessarily true.In the proof of Lemma 8, we have n 2 e − √ log n in the exponent, which can beat the number of choices of S, whereas here pn 2 e − √ log n is not necessarily larger than n.However, we have (s, pn 2 / log n, 3pn) ∈ O, see Claim 25.Finally, we will use the following lemma to give lower bounds on the number of copies ofF 5 .For fixed vertex v, vertex set A ⊆ [n] \ {v}, subset T of N [n]\A,[n]\A (v),and subset E of {vxw ∈ G : x ∈ A} satisfying that for every x ∈ A, there exists e ∈ E such that x ∈ e, define K(v, E, A, T ) := {xyz : x ∈ A, yz ∈ T, there exists e ∈ E such that x ∈ e, y / ∈ e, z / ∈ e}, and G(v, E, A, T ) := K(v, E, A, T ) ∩ G.We have that E(|G(v, E, A, T )|) = p|K(v, E, A, T )|;note that here the randomness in this expectation is of the hyperedges in {xyz : x ∈ A, yz ∈ T } being or not in G. Also note that the events of the hyperedges in {xyz : x ∈ A, yz ∈ T } being or not in G are independent of the events of hyperedges containing v being in G.For every xyz ∈ G(v, E, A, T ) with x ∈ A, yz ∈ T , we can find a copy of F 5 = {yzv, yzx, vxw} in G where vxw ∈ E, see Figure4.The condition y / ∈ e, z / ∈ e in the definition of K(v, E, A, T ) guarantees that we indeed find an F 5 instead of a K − 4 .
Without loss of generality, we may assume |H 1 | |H 2 |, |H 3 |.Besides, by Proposition 2, we know that w.h.p. π is balanced and 3 i=1 |H i | δpn 3 /3, where δ is a constant smaller than the δ's in Propositions 12 and 13.Now let B(π) := {e ∈ G : there exists uv ∈ Q(π) such that uv ⊂ e} and H ′ := H \ B(π), so the shadow graph of H ′ 1 is disjoint from Q(π).Since B(π) consists of only non-crossing hyperedges of H, π is still a partition maximizing |H ′ π | and then n x is trivially 0. For every positive integer sε 1 n √ log n , r = pn√ log n s, and i = pn log log n 500 √ log n , we have (s, r, i) ∈ O (see Claim 23 in the Appendix for the proof).Hence, by Lemma 9, we get r x pn √ log n d J ′ (x).By Lemma 6, we can assume every pair of vertices has codegree at most pn √ log n log log n in G.We conclude x) ε 2 pn 2 }, and S 2 := S \ S 1 .For the following lemmas, we always assume that | Hπ | δpn 3 / log n and the assumptions of Proposition 12 hold.Lemma 16.With high probability |S| ε 3 n/ √ log n.
be a balanced partition maximizing |H π |.Then there exist positive constants C and δ such that if p > C √ log n/n and if the following conditions hold: 1. |H 1 |, |H 2 |, |H 3 | δpn 3 /3, 2. the shadow graph of H 1 is disjoint from Q(π), then with high probability | Hπ | 3|H 1 |, where equality is possible only if H is tripartite.
r = pn 500 s, and i = 3ε 1 pn, we have (s, r, i) ∈ O (see Claim 24 in the Appendix for the proof).Hence, by Lemma 9, we have r x pn 500 d J ′ (x).By Lemma 6, we can assume every pair of vertices has codegree at most pn √ log n log log n in G. Besides, we have (s, pn 2 / log n, 3pn) ∈ O for every 1 s n (see Claim 25 in the Appendix for the proof), so by Lemma 9, there are at most pn 2 / log n pairs (y, z) where y ∈ V 2 , z ∈ V 3 such that |N(y, z) ∩ N J ′ (x)| 3pn.We conclude Claim 27.For every positive integer s ε 3 n, we have s, ε 2 pn 2 2 , 3ε 3 pn ∈ O.Proof.We have that g(p, s, r, i) is ).Claim 26.For every positive integer sε 3 n √ log n , we have s, ε 2 pn 2 2 , 3ε 3 pn √ log n ∈ O.Proof.We have that g(p, s, r, i) is