Let $n \geq 1$ be an integer, and let $S$ be a set of integer pairs $(a,b)$ with $1 \leq a < b \leq 2^n$. Assume $|S| > n \cdot 2^{n+1}$. Prove that there exists four integers $a < b < c < d$ such that $S$ contains all three pairs $(a,c)$, $(b,d)$ and $(a,d)$.
Problem
Source: USA TST 2011 P8
Tags: induction, graph theory, combinatorics
28.07.2011 19:40
Are you sure $|S| > n \cdot 2^{n+1}$ shouldn't be $|S| \geq n \cdot 2^n$ (and even this assumption is far from being sharp)? Because my proof holds for the latter as well, but then again, who knows whether it is really a proof? Note that whenever I refer to the "problem" below, I mean the problem modified in such a way that the condition $|S| > n \cdot 2^{n+1}$ is replaced by $|S| \geq n \cdot 2^n$. I proceed by induction over $n$. For the induction base, take either $n=0$ or $n=1$; both of these cases are trivial. (Or take the case $n=2$; it is not harder.) Now to the induction step: Consider some $n\geq 1$. Assume that the problem is true for $n-1$ instead of $n$. Let us prove that the problem holds for $n$. Let us distinguish between three cases: Case 1: There are at least $\left(n-1\right)\cdot 2^{n-1}$ pairs $\left(a,b\right)\in S$ satisfying $a<b\leq 2^{n-1}$. Case 2: There are at least $\left(n-1\right)\cdot 2^{n-1}$ pairs $\left(a,b\right)\in S$ satisfying $2^{n-1}<a<b$. Case 3: There are at least $2^n$ pairs $\left(a,b\right)\in S$ satisfying $a\leq 2^{n-1}<b$. In fact, these three cases are the only cases that can occur (because every pair $\left(a,b\right)\in S$ satisfies one and only one of the three relations $a<b\leq 2^{n-1}$, $2^{n-1}<a<b$ and $a\leq 2^{n-1}< b$ (since $\left(a,b\right)\in S$ yields $a<b$), and therefore we have (the number of all pairs $\left(a,b\right)\in S$ satisfying $a<b\leq 2^{n-1}$) + (the number of all pairs $\left(a,b\right)\in S$ satisfying $2^{n-1}<a<b$) + (the number of all pairs $\left(a,b\right)\in S$ satisfying $a\leq 2^{n-1}< b$) = (the number of all pairs $\left(a,b\right)\in S$) = $\left|S\right| \geq n\cdot 2^n = \left(n-1\right)\cdot 2^{n-1}+\left(n-1\right)\cdot 2^{n-1}+2^n$). In Case 1, we obtain the desired conclusion directly from the induction assumption (applied to the set $\left\{\left(a,b\right)\mid \left(a,b\right)\in S\text{ and }a<b\leq 2^{n-1}\right\}$ instead of $S$). In Case 2, we obtain the desired conclusion from the induction assumption (applied to the set $\left\{\left(a-2^{n-1},b-2^{n-1}\right)\mid \left(a,b\right)\in S\text{ and }2^{n-1}<a<b\right\}$ instead of $S$). So it remains to consider Case 3. In this case, we solve the problem indirectly: That is, we assume that the opposite of the problem holds, i. e., that (1) there are no four integers $a<b<c<d$ such that $S$ contains all three pairs $\left(a,c\right)$, $\left(b,d\right)$ and $\left(a,d\right)$. Let $A=\left\{1,2,...,2^{n-1}\right\}$ and $B=\left\{2^{n-1}+1,2^{n-1}+2,...,2^n\right\}$. Clearly, $A\cap B=\emptyset$ and $A\cup B=\left\{1,2,...,2^n\right\}$. Now, consider the bipartite graph whose left vertices are the elements of $A$, whose right vertices are the elements of $B$, and whose edges are the pairs $\left(a,b\right)\in S$ satisfying $a\leq 2^{n-1}< b$. Since we are in Case 3, this graph therefore has at least $2^n$ edges, so that it has at least as many edges as it has vertices. Thus, this graph cannot be a tree, so it must contain a cycle. Let $\left(a_1,a_2,...,a_t\right)$ be this cycle, where $t\geq 3$. Since any cycle in a bipartite graph has an even number of vertices, we see that $t$ is even. Let us WLOG assume that $a_1\in A$ (because otherwise, we can shift the cycle by one vertex). Then, $a_i\in A$ for every odd $i$, and $a_i\in B$ for every even $i$. (This is because our graph is bipartite, and any cycle in a bipartite graph must alternate between left and right vertices.) Since every element of $A$ is smaller than every element of $B$, we conclude that $a_i < a_j$ for every odd $i$ and even $j$. Let $a_{t+1}$ denote $a_1$. Since $\left(a_1,a_2,...,a_t\right)$ is a cycle in our graph, we know that $\left(a_i,a_{i+1}\right)\in S$ for every $i\in\left\{1,2,...,t\right\}$. Let us also WLOG assume that $a_1\geq a_3$ (because otherwise we can just turn around the cycle in such a way that $a_1$, $a_2$, $a_3$ become $a_3$, $a_2$, $a_1$, respectively). Thus, $a_1 > a_3$ (since $a_1\neq a_3$). We now claim that (2) $a_i > a_{i+2}$ for every odd $i\in\left\{1,2,...,t-1\right\}$. In fact, we prove (2) by induction over $i$: For $i=1$, we already have shown that (2) holds (since $a_1 > a_3$). This completes the induction base in the proof of (2). For the induction step, let us now consider some odd $i\in\left\{2,3,...,t-1\right\}$. Assuming that we already have shown $a_{i-2} > a_i$, we need to prove $a_i > a_{i+2}$. Since $i$ is odd, we have $a_{i-2}\in A$, $a_{i-1}\in B$, $a_{i+1}\in B$ and $a_{i+2}\in A$. Remembering that every element of $A$ is smaller than every element of $B$, we conclude that $a_{i-2} < a_{i+1}$ and $a_{i+2} < a_{i-1}$. Now, $a_{i-1} \leq a_{i+1}$, because otherwise (1) would be invalid for $\left(a,b,c,d\right)=\left(a_i,a_{i-2},a_{i+1},a_{i-1}\right)$. Thus, $a_{i-1} < a_{i+1}$ (because $a_{i-1}\neq a_{i+1}$). Therefore, $a_i \geq a_{i+2}$, because otherwise (1) would be invalid for $\left(a,b,c,d\right)=\left(a_i,a_{i+2},a_{i-1},a_{i+1}\right)$. Thus, $a_i > a_{i+2}$ (since $a_i\neq a_{i+2}$), and this completes the induction step in the proof of (2). Now, since $t$ is even, the relation (2) yields $a_1 > a_3 > a_5 > ... > a_{t+1}$, which is a contradiction to $a_{t+1} = a_1$. This contradiction shows that our assumption was invalid, and the problem is proven in Case 3 as well. This completes the induction. Now where is the catch?
28.07.2011 20:17
There is no catch. Many people noticed during the test that the bound was twice as high as it needed it to be. Your solution was basically the same as the most common one found during the contest. The official solution on the other hand was awkward and overcomplicated things.
12.04.2012 00:59
I think the following works as a simpler finish to Case 3 in darij grinberg's solution: Call a pair $(a, b)$, where $a \le 2^{n - 1} < b$, good if $a$ is also paired with $c$ such that $2^{n - 1} < c < b$. Call a pair $(a, b)$, $a \le 2^{n - 1} < b$, super if $b$ is also paired with $c$ such that $a < c \le 2^{n - 1}$. Considering all pairs $(a, b)$, st $a \le 2^{n - 1} < b$, if $a$ is paired with $s$ integers with $s \ge 1$, then $s - 1$ of those pairs are good. Similarly, if $b$ is paired with $s$ integers with $s \ge 1$, then $s - 1$ of those pairs are super. Let $x$ be the total number of pairs; then there are at least $x - 2^{n - 1}$ good pairs and $x - 2^{n - 1}$ super pairs. However, since $x > 2^{n}$, $x - 2^{n - 1} + x - 2^{n - 1} > x$, so there is some pair that is both good and super. A good and super pair satisfies the desired properties, so we're done.
23.12.2012 00:50
i think you can use induction on $|A\cup B|$ to finish case 3 easily. it's trivial for the original problem with $2^{n+1}$ pairs but i think that it can be worked out for $2^n$ pairs as well
24.09.2016 07:22
Alternatively, for case $3$, using the same notation as above surrounding the bipartite graph with branches corresponding to $A$ and $B$, since there are $2^n$ vertices and at least $2^n$ edges, there must exist an (even) cycle. Let the vertices in the first branch be $a_1, a_2, \ldots, a_{2^{n-1}}$ and let the vertices in the second branch be $b_{2^{n-1}+1}, b_{2^{n-1}+2}, \ldots, b_{2^n}$ (corresponding to the integers $1,2,\ldots, 2^n$). Let $C$ be a cycle in the graph and let $a_m, b_n, a_p, b_q$ be consecutive vertices in $C$. WLOG $p < m$. If $q < n$ then this produces the desired set. Otherwise, $q > n$. Likewise, if $b_q$'s successor $a_r$ is such that $r > m$, then we are again done. Proceeding in this manner, in order to avoid any of the desired sets, the $a_i$ indices $i$ must get smaller and smaller and the $b_j$ indices $j$ must get bigger and bigger along $C$. Since there are finitely many vertices, this cannot happen forever and there must appear such a set in the cycle.
29.11.2016 18:13
Actually, maybe as a simpler approach to dealing with case $3$, we can show by induction that for the set $\{1,2,\ldots,2k\}$ with at least $2k$ distinct pairs $(a,b)$ such that $1 \le a \le k$ and $k+1 \le b \le 2k$, there must exist three pairs of the described type (maybe this is what leader was talking about above -- I'm not sure). For $k = 2$, we have at least $4$ distinct pairs. There are exactly $4$ possible pairs going between $\{1,2\}$ and $\{3,4\}$ so in fact, we have all $4$ such pairs. In particular, we have $\{1,4\}, \{2,4\}, \{1,3\}$, satisfying the claim. Now consider $k = m \ge 3$ and assume true for all $k \le m-1$. It suffices to show the result exactly when there are exactly $2m$ pairs between $\{1,\ldots,m\}$ and $\{m+1,\ldots, 2m\}$ (if there are more, simply ignore/remove pairs until $2m$ are left). If there is $a \in \{1,\ldots,m\}$ which appears in at most one pair and $b \in \{m+1,\ldots,2m\}$ which also appears in at most one pair (where $(a,b)$ is not necessarily this pair), then remove $a$ and $b$, re-enumerating set elements if necessary, leaving the set $\{1,2,\ldots,2m-2\}$ with at least $2m-2$ pairs going between $\{1,\ldots,m-1\}$ and $\{m,\ldots,2m-2\}$. From the induction hypothesis, we get the claim in this case. If the above case does not hold, then we may assume WLOG that each $a \in \{1,\ldots,m\}$ is part of at least $2$ pairs to $\{m+1,\ldots,2m\}$. This yields at least $2m$ pairs. Since there are exactly $2m$ pairs, the inequality is in fact an equality and each such $a$ is in exactly $2$ pairs to $\{m+1,\ldots,2m\}$. In particular, $1$ is in two pairs $(1,c)$ and $(1,d)$ with $c < d$. If $d$ is in at least one more pair $(e,d)$, then $\{(1,c),(e,d),(1,d)\}$ satisfies the problem. Otherwise, $d$'s only pair is $(1,d)$. Thus, removing $1$ and $d$, as in the above case, and re-enumerating elements, we obtain the set $\{1,2,\ldots,2m-2\}$ with $2m-2$ pairs between $\{1,\ldots,m-1\}$ and $\{m,\ldots,2m-2\}$. Again, from the induction hypothesis, we are done.
03.09.2018 05:43
Here is a solution with yet another finish for "case 3." Assume $|S| \ge n\cdot 2^n$. Call the pairs $(a,c), (b,d), (a,d)$ for $a<b<c<d$ a violation. As in darij's solution, we proceed by induction. The base cases can be checked. Then, consider the problem for some $n$ given that it holds true for $n-1$. If there are $(n-1)\cdot 2^{n-1}$ pairs either all completely contained in $\left[1, 2^{n-1} \right ]$ or all completely contained in $\left[2^{n-1}+1,2^n \right]$, then we're done by induction. Assume this is not the case; then this leaves at least $X \ge 2^n$ pairs $(a,b)$ that have $a \in \left[1, 2^{n-1} \right ]$ and $b \in \left[2^{n-1}+1,2^n \right]$. The claim is that these $X$ pairs alone are sufficient to force the existence of a violation in $S$. For simplicity, delete all pairs that are not of this form, so that $|S|=X$. Assume for the sake of contradiction otherwise, that $S$ contains no violation. Perform the following algorithm: at each step, pick a number $k \in \left[1, 2^{n-1} \right ]$ such that the pair $P=(k,2^{n-1}+1)$ is not in $S$. If $k$ is not in any pairs, simply add $P$ into $S$. If $k$ is already in some pairs, delete from $S$ the pair $(k, m)$ where $m > 2^{n-1}+1$ is minimized and replace it with $P$. In either case, we can check that no new violations are created, and $|S|$ is non-decreasing. When the algorithm terminates, $S$ will contain the pairs $(k, 2^{n-1}+1)$ for all $k=1, 2, \dots 2^{n-1}$. It is not hard to see that now, each of the numbers $j=2^{n-1} + 2, \dots, 2^n$ can be contained in at most one pair: otherwise, we would have $(a, j), (b,j)$ with $a<b$ and the violation $a,b,2^{n-1}+1,j$. Thus, $S$ can have at most $2^{n-1} +( 2^{n-1}-1) = 2^n-1$ pairs, contradicting our assumption that $|S| \ge X \ge 2^n$. The result follows. $\blacksquare$
29.12.2018 23:09
The fact that $n\cdot 2^{n+1}\approx 2^n\log 2^n$ suggests a divide and conquer approach. Let $f(n)$ denote the maximum value of $|S|.$ We think of the elements of $S$ as intervals on $[1,2^n].$ By definition, there are at most $f(n-1)$ intervals wholly contained in $[1,2^{n-1}],[2^{n-1}+1,2^n],$ contributing $2f(n-1)$ intervals. Now we can restrict our attention to intervals that cross the midpoint. Enumerate the points to the left of the midpoint starting from the midpoint as $1,2,\cdots, 2^{n-1},$ and for each $1\leq i\leq 2^{n-1}$ let $A_i$ be the set of points on the right side connected to point $i.$ Lemma: Each $A_i$ contains at most one element among $A_1,\cdots, A_{i-1}.$ Proof: Else if there are two elements $x<y,$ let $y\in A_j.$ Then $i<j<x<y$ is a contradiction. Thus if $B_i$ is the set of new right points connected with left point $i,$ we see that $|A_i|\leq |B_i|+1.$ Thus \[\text{\# of crossing}=\sum_{i=1}^{2^{n-1}}|A_i|\leq \sum_{i=1}^{2^{n-1}}|B_i|+1\leq 2^{n-1}+\sum_{i=1}^{2^{n-1}}|B_i|\leq 2^n,\]and thus we obtain $f(n)\leq 2f(n-1)+2^n,$ which automatically implies $f(n)=cn2^n$ for some constant $c.$ But checking dumb base cases shows that the problem statement is really weak and we can guarantee $c\leq 2.$
30.12.2018 00:43
We first solve the problem for a square: Lemma: In a $s \times s$ grid, some tokens are placed. Suppose that there is no token which has both a different token below it and a different token to its right. Then at most $2s$ tokens were placed. Proof. For any token with some token below it, have it shoot a horizontal death ray to its right. By hypothesis, the death ray won't hit any other token. In particular, there are at most $s$ death rays, since no two death rays can occupy the same row. [asy][asy] size(6cm); for (int i=1; i<=8; ++i) { for (int j=1; j<=8; ++j) { if ( (i-j)%2==0 ) filldraw(shift(i-0.5,j-0.5)*unitsquare, invisible, grey); else draw(shift(i-0.5,j-0.5)*unitsquare, grey); } } draw( (1,1)--(1,4), blue); draw( (3,2)--(3,7), blue); draw( (5,3)--(5,8), blue); draw( (6,3)--(6,1), blue); draw( (1,4)--(8,4), red+1, EndArrow(TeXHead)); draw( (3,6)--(8,6), red+1, EndArrow(TeXHead)); draw( (3,7)--(8,7), red+1, EndArrow(TeXHead)); draw( (5,8)--(8,8), red+1, EndArrow(TeXHead)); draw( (6,3)--(8,3), red+1, EndArrow(TeXHead)); void token(pair P) { fill(circle(P, 0.2), black); } token( (1,4) ); token( (1,1) ); token( (2,1) ); token( (3,2) ); token( (3,6) ); token( (3,7) ); token( (4,1) ); token( (5,3) ); token( (5,8) ); token( (6,3) ); token( (6,1) ); token( (7,5) ); token( (8,2) ); [/asy][/asy] Also are at most $s$ tokens not emitting a death ray (at most one per column). Therefore there are at most $s+s=2s$ tokens. $\blacksquare$ Remark: I think it shouldn't be hard to argue a bit more carefully to prove that $2s-1$ is the true optimum. Now for the present problem, we prove the stronger result that if no such inverted-L exists, then $|S| \le n \cdot 2^n$. The proof is by induction on $n$. When $n=1$ there is nothing to prove. For any $n > 1$, we observe the points of $S$ form a staircase which decomposes into two staircases of half the size plus a $2^{n-1} \times 2^{n-1}$ square. Shown below is the picture for $n = 3$. [asy][asy] size(6cm); for (int i=1; i<=8; ++i) { label("$"+(string) i+"$", (i,1), dir(-90), fontsize(9pt)); label("$"+(string) i+"$", (0.8,i), dir(180), fontsize(9pt)); draw((1,i)--(8,i), lightgrey); draw((i,1)--(i,8), lightgrey); } filldraw( box((0.8,4.8), (4.2,8.2)), invisible, blue ); filldraw( (0.8,1.3)--(0.8,4.2)--(3.7,4.2)--cycle, invisible, red ); filldraw( (4.8,5.3)--(4.8,8.2)--(7.7,8.2)--cycle, invisible, red ); for (int i=1; i<=8; ++i) { for (int j=i+1; j<=8; ++j) { dot( (i,j) ); } } [/asy][/asy] By the lemma, the square has at most $2 \cdot 2^{n-1} = 2^n$ elements of $S$. Each triangle, by induction has at most $(n-1) \cdot 2^{n-1}$ elements. So the total is at most \[ (n-1) \cdot 2^{n-1} + (n-1) \cdot 2^{n-1} + 2^n = n \cdot 2^n \]as desired.
30.12.2018 21:40
Here's a small generalization of the problem. Generalization wrote: Let $n \geq 1$ be an integer, and let $S$ be a set of integer pairs $(a,b)$ with $1 \leq a < b \leq n$. Call $S$ good if there do not exist four integers $a < b < c < d$ such that $S$ contains all three pairs $(a,c)$, $(b,d)$ and $(a,d)$. Find the maximum possible size of a good $S$. I conjecture the answer is $x_n = \sum_{k=1}^n \lceil \log_2 k \rceil$, which might have a simpler form. But I only have a proof for powers of two so far, when $x_{2^n} = (n-1) \cdot 2^n + 1$. Many of the posts above show that $x_{2k} \leq 2x_k + 2k - 1$, where $2k-1$ is the bound for "case 3". This is enough to obtain the correct upper bound for $x_{2^n}$: \[ x_{2^n} \leq 2x_{2^{n-1}} + 2^n - 1 \leq 2((n-2) \cdot 2^{n-1} + 1) + 2^n - 1 = (n-1) \cdot 2^n + 1. \] The construction of an $S$ of size $x_{2^n}$ for which no $a,b,c,d$ exist: all pairs $(a,b)$ such that $b - a$ is a power of 2. It's easy to check this gets the right size. Suppose for the sake of contradiction $a,b,c,d$ existed for this $S$. Then $c - a$, $d - b$, and $d - a$ are all powers of 2. We have $c-a < d-a$ and $d-b < d-a$. But both sides are powers of two, so these imply $2(c-a) \leq d-a$ and $2(d-b) \leq d-a$. Adding these two inequalities gives $c-a + d-b \leq d-a$, contradicting $b < c$. The conjecture above comes from my belief that this same construction (powers of 2 differences) is also optimal for non powers of 2, but I can't prove or disprove it.
09.07.2020 19:02
Joint solution with biomathematics, MathPassionForever and BOBTHEGR8. We geometrize the problem by treating the pair $(a,b)$ as the lattice point $(a,b)$. Then, the problem reduces to finding a triplet of points which form a flipped $L-$ shape(along with another condition but that doesn't harm the solution)in the set $S$. Let the maximum cardinality which disallows this configuration for $n$ be $a_n$. We claim that $a_n \le n \cdot 2^n$. Let $A$ denote the set $ \left \{ (x,y) \mid 1 \le x< y \le 2^n \right \}$. Note that $A$ is a right triangular region. See that $S \subset A$. Note that $A$ neatly partitions into three parts: points belonging to a $2^{n-1} \times 2^{n-1}$ square in the top right part of $A$(Call it $A_1$) and the two right triangles similar to $A$ below the square and to its right(Call them $B_1$ and $B_2$ respectively). Now, as $S \subset A$, the points in $S$ also partition into sets of points that are subsets of $A_1, B_1$, and $B_2$ respectively. Note that $A_1$ cannot have more than $2^n$ points of $S$. Indeed, for each column, consider the points other than the bottommost point.Then these points lie in distinct rows. So at most $2^{n-1}$ bottommost points, and then at most $2^{n-1}$ other points. So, we get a maximum of $2 \cdot 2^{n-1}$ points of $S$ in $A_1$. Also, by the inductive hypothesis, if the maximum number of points of $S$ in $B_1$ and $B_2$ are $x_1$ and $x_2$ resp., then $x_1, x_2 \le (n-1) \cdot 2^{n-1}$. So, $a_n \le 2^n+2 \cdot (n-1) \cdot 2^{n-1} = n \cdot 2^n$, finishing the solution.
01.09.2021 20:29
Can we fix the bound please We will prove this problem for $|S|\geq n\cdot 2^{n}$ by induction on $n$. Our base case of $n = 2$ is obviously true (since $|S| = 8$ and there are only $6$ pairs possible). Now, assume it's true for $n-1$. FTSOC, assume there does not exist such a quadruplet. Consider all the pairs $(a,b)$ such that $1\leq a < b \leq 2^{n-1}$. By our inductive hypothesis, there are less than $(n-1)\cdot 2^{n-1}$ such pairs. Similarly, there are less than $(n-1)\cdot 2^{n-1}$ pairs $(a,b)$ where $2^{n-1} + 1\leq a < b \leq 2^{n}$. Thus, there are at least $2^{n}$ pairs $(a,b)$ where $1\leq a\leq 2^{n-1} < b \leq 2^{n}$. Consider the graph with $2^{n}$ vertices, where we connect vertex $a,b$ if $1\leq a \leq 2^{n-1} < b \leq 2^{n}$ is a pair in $S$. Since there are at least $2^{n}$ edges, a cycle must exist. Let this cycle go through vertices $a_{1}, a_{2}, \ldots a_{2k}$, where $a_{2i} > 2^{n-1}$. WLOG, let $a_{2} > a_{2k}$ (or else we can just reverse the cycle). However, if $a_{2} > a_{2k}$, then (using the property that no quadruplets exist) \[a_{3} < a_{1} \Rightarrow a_{4} > a_{2} \Rightarrow a_{5} < a_{3} \Rightarrow \ldots\]\[\Rightarrow a_{1} < a_{2k-1} < \ldots < a_{3} < a_{1}\]Contradiction. Therefore, at least one quadruplet exists, which finishes the induction.
17.07.2023 06:58
Consider $S=S_n$ as the edge set of graph $G_n=(V_n,S_n)$, where $V_n:=\{1,2,\dots,2^n\}$. Denote by $f(n)$ the largest number of edges that $G_n$ can have without containing the three pairs $(a,c), (b,d),(a,d) $ that the problem stated. Clearly $f(1)=1$. Split $V_{n+1}$ into $X:=\{1,2,\dots,2^n\}$ and $Y:=\{2^n+1,\dots,2^{n+1}\}$. Set $E_0$ to be the set of edges with one vertex in $X$ and the other in $Y$, $E_1$ and $E_2$ to be respectively the set of edges with both vertices in $X$ and in $Y$. Obviously we have $\mid E_1\mid, \mid E_2\mid \leq f(n)$. We claim that the bipartite subgraph $G'(V_{n+1},E_0)$ is cycle-free, i.e. a forest. Suppose otherwise, consider an even cycle $u_1v_1\dots u_lv_l$ with $u_1,\dots,u_l \in X$ and $v_1,\dots, v_l \in Y$. Assume that $u_j=\min\{u_1,u_2,\dots, u_l\}$ and $u_j$ is connected to $v_j$ and $v_{j+1}$. Without loss of generality $v_j>v_{j+1}$. Then the three edges $u_jv_{j+1},u_{j+1}v_{j},u_{j}v_{j}$ is a contradiction. Hence $G'$ is a forest with $2^{n+1}$ vertices, thus $\mid E_0\mid<2^{n+1}$. Therefore $f(n+1)< 2f(n)+2^{n+1}$, from here we easily conclude that $f(n)<n\cdot 2^n$ holds for any positive integer $n$.
26.07.2023 23:52
15.08.2023 08:42
Solved with CT17. Here's a short solution that, in its current form, doesn't work for the stronger bound of $n \cdot 2^n$. Let the ordered pairs of $S$ represent lattice points in the coordinate plane. For a positive integer $i$, let $A_i$ be the set of ordered pairs of integers $(a,b)$ with $1 \le a<b \le 2^n$ and $2^{i-1} \le b-a<2^i$. Let $S_i=S \cap A_i$. We claim that if there do not exist such $a,b,c,d$, then $|S_i| \le 2^{n+1}$, which suffices because it implies $|S|=|S_1|+|S_2|+\cdots+|S_n| \le n \cdot 2^{n+1}$. Let $P$, $Q$, and $R$ be points in $A_i$ such that $Q$ is directly below $P$ and $R$ is directly to the right of $P$. We can check that if $P=(a,d)$, $Q=(a,c)$, and $R=(b,d)$, then $a<b<c<d$. Thus, no point in $S_i$ can have both a point in $S_i$ directly below it and a point in $S_i$ directly to the right of it. If a point $P$ in $S_i$ has a point directly below it, then consider the projection of $P$ to the $y$-axis. Otherwise, consider the projection of $P$ to the $x$-axis. We claim that these $|S_i|$ projections must be distinct. Indeed, if two points project to the same point on the $y$-axis, then the point on the left should have been projected to the $x$-axis, a contradiction. If two points project to the same point on the $x$-axis, then the point on the top should have been projected to the $y$-axis, a contradiction. Since the only possible projections are the $2^{n+1}$ points $(1,0),\ldots,(2^n,0),(0,1),\ldots,(0,2^n)$, we must have $|S_i| \le 2^{n+1}$, as desired. $\square$
26.08.2023 17:25
Here's a proof for $|S|\geq (n-1)2^n+2$, which is tight. Interpret the problem on a $(2^n-1)\times(2^n-1)$ "right triangle" with right angle in the top left. We color $(n-1)2^n+2$ of the cells black and wish to find a rectangle contained entirely within the triangle whose bottom left, top left, and top right corners are all colored black. Dissect the "isosceles right triangle" into two $(2^{n-1}-1)\times(2^{n-1}-1)$ right triangles and a $2^{n-1} \times 2^{n-1}$ square. By induction (with the base case of $n=1$ being vacuous) it suffices to suppose that there are $((n-1)2^n+2)-2((n-2)2^{n-1}+1)=2^n$ black cells in the square and find such a rectangle inside it. For every black cell in the square, there are either no black cells below it or no black cells to its right (possibly both). Therefore, at each black cell, either fire a laser downwards or to the right such that this laser does not pass through any other black cells, and consider which cell on either the bottom row or the rightmost column that this laser hits (for cells lying on the bottom row or rightmost column, this is itself, and not any other cell—we essentially stop the laser once it hits this region). Clearly every cell in the bottom row or rightmost column, of which there are $2^n-1$, is hit by at most $1$ laser. But since we have $2^n$ lasers, this is a contradiction. $\blacksquare$