Exact results on generalized Erdős-Gallai problems

Generalized Turán problems have been a central topic of study in extremal combinatorics throughout the last few decades. One such problem, maximizing the number of cliques of size t in a graph of a fixed order that does not contain any path of a given length, was recently considered and asymptotically solved by Luo. We fully resolve this problem by characterizing all possible extremal graphs. Furthermore, motivated by work in our previous paper, we also study the problem when the number of edges is fixed instead of the number of vertices. We similarly obtain exact answers for this latter problem.


Introduction
One of the oldest problem in extremal graph theory is to determine ex(n, P k ), which denotes the maximum number of edges in an n-vertex graph that does not contain a copy of P k (a path with k vertices). Erdős and Gallai showed in [12] that ex(n, P k ) ≤ k−2 2 · n. It is easy to see that this is tight when k − 1 divides n where the extremal graph is the vertex-disjoint union of n k−1 copies of K k−1 . Later in [16], Faudree and Schelp determined ex(n, P k ) exactly for all values of n and described the extremal graphs. Theorem 1.1 ([16], [27]). Let n = q(k − 1) + r, 0 ≤ r < k − 1, and k ≥ 2. Then, ex(n, P k ) = q k − 1 2 + r 2 .

Moreover, the extremal graphs are
• qK t−1 ∪ K r , vertex disjoint unions of q complete graphs K k−1 and a K r , or • when k is even and r is either k 2 or k 2 − 1, another extremal graphs can be obtained by taking a vertex disjoint union of t copies of K k−1 (0 ≤ t < q) and a copy of H, where H is the graph achieved by adding all the edges between a clique with k 2 − 1 vertices and an independent set with n − t(k − 1) − k 2 + 1 vertices. A more general extremal problem deals with forbidding a fixed tree instead of a path (see the well-known Erdős-Sós conjecture [10]). Interested readers can peruse the excellent survey [17] by Füredi and Simonovits for more related problems. In the recent decade, there has been a growing interest in studying the generalized variant where one maximizes the number of copies of a fixed graph instead of the number of edges (see, e.g., [3], [4], [15], [19], [20], and [24]). Following the notation in [3], for two graphs T and H, the generalized extremal function ex(n, T, H) is defined to be the maximum number of copies of T in an n-vertex H-free graph. Note that for T = K 2 , we have the standard extremal function where we maximize the number edges in an n-vertex H-free graph, i.e., ex(n, K 2 , H) = ex(n, H). Recently, Luo considered the generalized version of Theorem 1.1 in [32], where she proved the following statement as a corollary. Luo's result was useful in investigating certain Turán-type problems in hypergraphs (see, e.g., [23]). Notably, Ning and Peng provided some extensions and applications of Theorem 1.2 in [34]. In this paper, we strengthen Theorem 1.2 by proving an exact result on ex(n, K t , P k ) with the classification of all extremal graphs. For the convenience of writing, we denote the number of cliques of order t in a graph G by k t (G).

Theorem 1.3. For any positive integers n and
Moreover, qK k−1 ∪ K r is the unique graph satisfying the equality when t ≤ r. If t > r, then G is an extremal graph if and only if G is isomorphic to qK k−1 ∪ L, where L is any graph on r vertices.
In our proof of Theorem 1.3, we have used some convexity inequalities along with a recent generalized extremal result on maximizing the number of cliques in a graph with a given maximum degree. This problem has its own history. After substantial progress made in [1], [2], [7], [8], [11], [18], [21], and [33], Chase recently resolved the problem in [5] by proving the following theorem. [21]). For any positive integers n, ∆, t ≥ 3, and any graph G on n vertices with maximum degree ∆, we have that k t (G) ≤ k t (qK ∆+1 ∪ K r ), where n = q(∆ + 1) + r, 0 ≤ r ≤ ∆. Moreover, qK ∆+1 ∪ K r is the unique graph satisfying the equality when t ≤ r. If t > r, then G is an extremal graph if and only if G is isomorphic to qK k−1 ∪ L for some r-vertex graph L.
The edge analogue of some of the classical extremal problems, where the number of edges is fixed instead of the number of vertices, have been vastly investigated (see, e.g., [13] and [14]). For the edge analogue of Theorem 1.4 (see, e.g., [6], [29], and [30]), we have previously proved the following statement.
Motivated by Theorem 1.5, we study the edge analogue of the problem in Theorem 1.3 with the classification of all extremal graphs. Note that adding or deleting isolated vertices from a graph does not change the number of edges nor the number of K t 's for t ≥ 3. Thus, in this paper when we discuss the edge variant, two graphs are considered to be equivalent if they are isomorphic after deleting all the isolated vertices.
In order to describe the extremal graphs, we need a couple of definitions which are similar to the ones in [6]. First, we introduce the notions of colex (colexiographic) order and graphs. Colex order on the finite subsets of the natural number set N is defined as the following: for The colex graph L m on m edges is defined as the graph with the vertex set N and edges are the first m sets of size 2 in colex order. Note when m = r 2 + s where 0 ≤ s < r, then L m is the graph containing a clique of order r and an additional vertex adjacent to s vertices of the clique. The celebrated Kruskal-Katona theorem implies the following. Theorem 1.6 ([26], [28]). For any positive integers t, m, and any graph G on m edges, we have that k t (G) ≤ k t (L m ). Moreover, L m is the unique graph satisfying the equality when s ≥ t − 1, where m = r 2 + s with 0 ≤ s < r. Remark. For Theorem 1.6, if r ≥ t and s < t − 1, a graph G satisfies the equality if and only if G is an m-edge graph which contains K r as a subgraph. On the other hand, if r < t, then any graph with m edges satisfies the equality, because no graph on m edges have a copy of K t .
Next, we define the following class of graphs.
Definition. For m = 0, let L t,k (m) be the family of empty graph, and for 0 < m ≤ k−1 2 , call L t,k (m) to be the following family of graphs, where m = r 2 + s with 0 ≤ s < r. • If s ≥ t − 1, then L t,k (m) contains just the colex graph L m .
• If r ≥ t and s < t − 1, then L t,k (m) contains not only L m , but also all m-edge P k -free graphs that contain K r as a subgraph.
• If r < t, then L t,k (m) contains not only L m , but also all m-edge P k -free graphs.
Next, we state our second main result.
Note that if t ≥ k in Theorem 1.7, then any graph G with a copy of K t contains a copy of P k , hence ex(n, K t , P k ) = 0. It can be easily checked that the case q = 0 in Theorem 1.7 is a direct corollary of Theorem 1.6. Observe that since the extremal number of K t 's is non-decreasing in terms of m in Theorem 1.5. We also remark that for the extremal construction in Theorem 1.7, the most restrictive case is when where we obtain the same unique extremal graph as the one in Theorem 1.5 for the same range of s. To prove Theorem 1.7, we follow similar strategies as we did in [6].
The rest of this paper is organized as follows. In the next section, we provide a full proof of Theorem 1.3. In Section 3, we prove the edge-variant, Theorem 1.7, by first developing some relevant structural results. We end with a few concluding remarks in Section 4. Since certain proofs are almost identical to some results in our previous paper [6], we will present them only in the appendix at the end of this paper.

Proof of Theorem 1.3
In this section, our goal is to prove Theorem 1.3. The strategy is to first assume that G is a minimum counter-example. In particular, assume that there exist a minimum t ≥ 3 and a P k -free graph G with minimum order n = q(k − 1) + r such that k t (G) ≥ k t (qK k−1 ∪ K r ) and G is not one of the extremal graphs described in Theorem 1.3. We start by proving some structural results about this minimum counter-example G and lastly show that such examples cannot exist.
Note that if n ≤ k − 1, it is easy to check that G = K n maximizes k t (G). Moreover, if n ≥ t, then K n is the unique extremal graph. Also, if n < t, then any graph on n vertices serve as an extremal graph, because no graph on n vertices contain a copy of K t . Thus, for the rest of this section, we may assume that n ≥ k.
Lemma 2.1. If G is a minimum counter-example, then G has minimum degree at least r.
Proof. We may trivially assume that r > 0. Assume for the sake of contradiction that there exists a vertex v with degree β < r. Note that there are at most β t−1 many copies of K t 's containing v. Consider G\v, which is not a counter-example to Theorem 1.3. Since β < r, Then, the above inequalities are tight and G\v is one of the extremal graphs. In particular, G\v and G contain q copies of K k−1 . Note that all these cliques are disjoint and disconnected, otherwise G contains a copy of P k . So, G is of the form qK k−1 ∪ L where L is an r-vertex graph. If t > r, then we have a contradiction to the fact that G is a counterexample. If t ≤ r, then looking at the last two inequalities above, since they are tight, we can also conclude that β = r − 1 and there are β t−1 many K t 's containing v. Thus, v is in a clique of size r, proving G = qK k−1 ∪ K r , a contradiction.
Unlike the minimum degree, we are unable to bound the maximum degree of G in such a way. However, we can obtain an upper-bound for the number of K t 's containing any vertex v based on its degree and k. Slightly abusing the notation, let k t (v) denote the number of K t 's containing v.
then the inequality is strict, i.e., equality cannot be achieved.
Proof. Let N(v) denote the set of all the vertices in the neighborhood of v. Note that the number of copies of K t containing v is the same as the number of copies of K t−1 in N(v). Since G is P k -free, it follows that the graph induced by N(v) is P k−1 -free. Hence, by the minimality of t, we may apply Theorem 1.3 on N(v) for t ≥ 4 or apply Theorem 1.1 on N(v) for t = 3, and obtain k t (v) ≤ a k−2 t−1 + b t−1 . Thus, it remains to show that this bound is never achieved when d(v) ≥ k − 1. Suppose for the sake of contradiction that this bound is achieved, then the graph induced by N(v) is one of the extremal graphs, hence contains a copy of P k−2 . Since d(v) ≥ k − 1, there exists a vertex u ∈ N(v) outside of this path. Then, one can extend the path to u via v, obtaining a path on k vertices, a contradiction.

Then, to satisfy Condition (2.3), consider the sequence {y
by adding as many 1's as needed at the end of {y i } N i=1 , until the condition is satisfied. We similarly create {x ′ } N ′ i=1 by padding the x sequence with 0's until the two sequences have the same length. Note that this does not affect Condition (2.1). In order to show that Condition (2.2), is satisfied, we consider the following three ranges separately.
Case 1: If 1 ≤ i ≤ q(k − 1), then Case 2: q(k − 1) + r < i < N ′ , then Case 3: If q(k − 1) < i ≤ q(k − 1) + r, then since every vertex in G has degree at least r, split k−2 (d(v)) outputs an integer at least r for all v ∈ V (G). Then, it follows that the first n = q(k − 1) + r elements in the sequence y ′ are all at least r. Hence q(k−1)+r Then, it follows from Karamata's inequality (2.4 . It follows from Theorem 1.4 that G has a vertex of degree more than k − 2. Then, it follows from the moreover part of Lemma 2.2 and the construction of the y sequence that N i=1 We end this section with a remark that it is possible to prove Theorem 1.3 without using Theorem 1.4. However, a more careful analysis is required.

Proof of Theorem 1.7
Given a fixed value t ≥ 3, we assume that G is a minimum counter-example to Theorem 1.7. In particular, we assume that G has q k−1 2 + r 2 + s many edges where 0 ≤ s < r ≤ k − 2, k t (G) ≥ q k−1 t + r t + s t−1 , and G is not one of the extremal structures (i.e. G = qK ∆+1 ∪L where L ∈ L t,k ( r 2 + s)). We may assume that 0 ≤ s < r, because any non-negative integer b can be uniquely written in the form b = r 2 + s for integers 0 ≤ s < r. Furthermore, we assume that any other graph with the same number of edges has at most as many K t 's as G.
As we have discussed in the introduction, we may also assume that q ≥ 1. In this section, we will show that G must have certain structural properties which will be used to achieve contradictions.
Lemma 3.1. If G is a minimum counter-example, then G is connected. Lemma 3.1 was proved in the context of Theorem 1.5 in [6]. The same proof also works within the current context, barring some minor alterations. To avoid being sidetracked by these ad hoc changes, we defer the full proof to the appendix. On an intuitive level, if a counter-example G is not connected, then one of its connected components should be a smaller counter-example.

Lemma 3.2. If G is a minimum counter-example, then G has minimum degree at least r.
Proof. For the sake of contradiction, assume that there exists v ∈ V (G) whose degree is 0 < β < r. Consider the graph G\v.
Since G\v is not a counter-example, we can conclude that G\v is one of the extremal structures in Theorem 1.7. Hence, G\v, and thus G, must contain a copy of K k−1 . Note that no vertices in this clique has any other neighbors in G otherwise there exists a path on k vertices. Then, G is not connected, contradicting Lemma 3.1.

Lemma 3.3.
If G is a minimum counter-example, then r ≤ k 2 − 1. To prove this lemma, we require the following well-known theorem by Dirac [9]. Lemma 3.5. If G is a minimum counter example, then G has at least q(k − 1) + (r + 1) vertices.
Proof. Suppose for the sake of contradiction that G has q ′ (k − 1) + r ′ < q(k − 1) + r + 1 vertices, where r ′ < k−1. Let T t := k t (qK k−1 ∪L ( r 2 )+s ) = q k−1 t + r t + s t−1 . By assumption, k t (G) ≥ T t . It follows from Theorem 1.3 that k t (G) ≤ q ′ k−1 t + r ′ t . Then, the inequality is tight and q = q ′ , r = r ′ and s < t − 1. However, if k t (G) = T t , it follows from Theorem 1.3 that G is one of the extremal structures, a contradiction. Lemma 3.6. If G is a minimum counter-example with m edges, then where α ∈ R is such that α(k − 2) + (n − α)r = 2m and n = q(k − 1) + (r + 1).
Proof. Let G be a minimum counter-example. Keep in mind that the number of vertices in G is at least n by Lemma 3.5. For any vertex v in a P k -free graph, the neighborhood N(v) is P k−1 -free, and hence by using Theorem 1.3 (or Theorem 1. x i = 2m and there exists j such that x i = k − 2 for all 1 ≤ i ≤ j, r ≤ x j+1 ≤ k − 2 and x i = r for all j + 1 < i ≤ n. Similar to the proof of Theorem 1.3 in Section 2, use Karamata's inequality to show that v∈V (G) k t (v) ≤ n i=1 x i t−1 . Now, find the unique 0 ≤ α ′ ≤ 1 such that α ′ (k − 2) + (1 − α ′ )r = x j+1 , and apply Jensen's inequality to get x j+1 Our lemma follows immediately where α = j + α ′ . Proof of Theorem 1.7. Let G be a minimum counter-example. Apply Lemma 3.6 to get α = q(k − 1) − 2(r−s) k−2−r , and we have the following: In order to show that k t (G) < T t , it suffices to prove that the last few terms after T k in the above inequality is strictly negative. Since r > s, we easily achieve a strict negativity when r < t − 1. Thus, we may assume r ≥ t − 1. In order to finish the proof, we claim that it suffices to prove the following two inequalities: If the above inequalities were true, we obtain a strict negativity by using Equation (3.2) to bound the first negative product term after T k , and finish with Equation (3.1).
To show the validity of Equation (3.1), the left-hand-side can be interpenetrated as choosing t − 1 people in a group R of size r without choosing all of them from a subgroup S ⊂ R of size s. The right-hand-side is an upper-bound on the number of ways a team can be formed by making sure at least one of them is from R \ S. It follows that the right-hand-side is at least as large as the left-hand-side.
To prove Equation (3.2), since t ≥ 3, we can first lower-bound the numerator of the left-hand-side by the following: The above inequality can be proved by using a similar counting trick as before: the lefthand-side is forming a team of t − 1 players from a group K of size k − 2 without having all of them from a subgroup R ⊂ K of size r. Meanwhile, the right-hand-side corresponds to first choosing one or two person from K \ R and filling the rest of the team from R. Then, Thus, to prove (3.2), it is enough to show that k−3−r r−1 ≥ 1. This follows from Lemma 3.3, which concludes our proof of Theorem 1.7.

Concluding remarks
As discussed in [3] and [22], an interesting question is to consider the generalized Erdős-Sós conjecture where the objective is to maximize the number of K t 's in an n-vertex graph that does not contain a copy of a fixed tree T . Asymptotically tight bounds were proven in [22] on this number assuming that the original Erdős-Sós conjecture holds for every tree. Theorem 1.3 and Theorem 1.4, for example, are the special cases of this generalized problem where we avoid the path P k and the star K 1,∆ respectively. For a related result on ex(n, H, T ) where H is a general graph and T is a tree, curious readers can refer to [31].
Similar to Theorem 1.7, the variation where the number of edges is fixed instead of the number of vertices when excluding other trees can also be considered. Thus, a natural objective is to find some non-trivial upper-bound for this edge variant, even for certain small classes of forbidden trees.
An alternative direction one might wish to explore is to consider the following generalization of Theorem 1.3 and Theorem 1.7: for 0 < s < t, m, and k positive integers, determine the maximum number of K t 's in a P k -free graph with m copies of K s . Once again, one may replace the forbidden structure with any other tree and pose similar interesting questions.

Acknowledgement
We thank Dániel Gerbner for informing us about the reference [22]. Now, suppose G contains a proper subgraph H that is a union of connected components of G where |E(H)| ≥ k−1 2 . Since H is not a counter-example to Theorem 1.5, either H contains strictly less K t 's than an extremal structure with the same number of edges, or H is an extremal structure. In the first case, replacing H with one of the extremal structures results in a graph that strictly increases the number of K t 's in G while maintaining the same number of edges, creating a worse minimum counter-example, a contradiction. In the latter case, H contains at least one copy of K k−1 , contradicting our previous claim. Thus, we may assume that all proper subgraphs that is a union of connected components of G has strictly less than k−1 2 edges. Let G 1 be a connected component of G and G 2 = G\G 1 . Note that if G 1 , G 2 are not extremal structures, then by replacing them with an extremal structure, one strictly increases the number of K t 's of G, contradicting the choice of G. Since neither are counterexamples nor contain at least k−1 2 edges, we may assume that G i ∈ L t,k ( r i 2 + s i ) where |E(G i )| = r i 2 + s i and 0 ≤ s i < r i ≤ k − 2 for i = 1, 2. Observe that if 0 < s i < t − 1, some edges in G i will not be part of any K t 's, contradicting Lemma 6.3. Similar contradiction is achieved if r i < t. Thus we may assume that r i ≥ t and either s i = 0 or s i ≥ t−1 for i = 1, 2. Observe in either cases, G i is the colex graph. Without loss of generality, we can assume that r 1 ≥ r 2 . Now, depending on the values of s 1 and s 2 , we will move a certain amount of edges from G 2 to G 1 and obtain a graph with strictly more K t 's than before, achieving a contradiction.