Olympiad Maths Prep

Track / Stage 7 / 243 of 300 #1643 of 2000

Problem 1643

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.6 Prove it

For any finite sets XX and YY of positive integers, denote by fX(k)f_{X}(k) the kthk^{\text{th}} smallest positive integer not in XX, and let
XY=X{fX(y):yY} X * Y = X \cup \{f_{X}(y) : y \in Y\}
Let AA be a set of a>0a > 0 positive integers, and let BB be a set of b>0b > 0 positive integers. Prove that if AB=BAA * B = B * A, then
A(A(A(AA)))A appears b times=B(B(B(BB)))B appears a times. \underbrace{A * (A * \cdots * (A * (A * A)) \ldots)}_{A \text{ appears } b \text{ times}} = \underbrace{B * (B * \cdots * (B * (B * B)) \ldots)}_{B \text{ appears } a \text{ times}}.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

For any function g:Z>0Z>0g: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0} and any subset XZ>0X \subset \mathbb{Z}_{>0}, we define g(X)={g(x):xX}g(X) = \{g(x): x \in X\}. We have that the image of fXf_{X} is fX(Z>0)=Z>0\Xf_{X}(\mathbb{Z}_{>0}) = \mathbb{Z}_{>0} \backslash X. We now show a general lemma about the operation *, with the goal of showing that * is associative. Lemma 1. Let XX and YY be finite sets of positive integers. The functions fXYf_{X * Y} and fXfYf_{X} \circ f_{Y} are equal. Proof. We have fXY(Z>0)=Z>0\(XY)=(Z>0\X)\fX(Y)=fX(Z>0)\fX(Y)=fX(Z>0\Y)=fX(fY(Z>0))f_{X * Y}(\mathbb{Z}_{>0}) = \mathbb{Z}_{>0} \backslash (X * Y) = (\mathbb{Z}_{>0} \backslash X) \backslash f_{X}(Y) = f_{X}(\mathbb{Z}_{>0}) \backslash f_{X}(Y) = f_{X}(\mathbb{Z}_{>0} \backslash Y) = f_{X}(f_{Y}(\mathbb{Z}_{>0})). Thus, the functions fXYf_{X * Y} and fXfYf_{X} \circ f_{Y} are strictly increasing functions with the same range. Because a strictly increasing function is uniquely defined by its range, we have fXY=fXfYf_{X * Y} = f_{X} \circ f_{Y}. Lemma 1 implies that * is associative, in the sense that (AB)C=A(BC)(A * B) * C = A * (B * C) for any finite sets A,BA, B, and CC of positive integers. We prove the associativity by noting
Z>0\((AB)C)=f(AB)C(Z>0)=fAB(fC(Z>0))=fA(fB(fC(Z>0)))=fA(fBC(Z>0))=fA(BC)(Z>0)=Z>0\(A(BC)) \begin{gathered} \mathbb{Z}_{>0} \backslash ((A * B) * C) = f_{(A * B) * C}(\mathbb{Z}_{>0}) = f_{A * B}(f_{C}(\mathbb{Z}_{>0})) = f_{A}(f_{B}(f_{C}(\mathbb{Z}_{>0}))) \\ = f_{A}(f_{B * C}(\mathbb{Z}_{>0})) = f_{A * (B * C)}(\mathbb{Z}_{>0}) = \mathbb{Z}_{>0} \backslash (A * (B * C)) \end{gathered}
In light of the associativity of *, we may drop the parentheses when we write expressions like A(BC)A * (B * C). We also introduce the notation
Xk=X(X(X(XX)))X appears k times X^{* k} = \underbrace{X * (X * \cdots * (X * (X * X)) \ldots)}_{X \text{ appears } k \text{ times}}
Our goal is then to show that AB=BAA * B = B * A implies Ab=BaA^{* b} = B^{* a}. We will do so via the following general lemma. Lemma 2. Suppose that XX and YY are finite sets of positive integers satisfying XY=YXX * Y = Y * X and X=Y|X| = |Y|. Then, we must have X=YX = Y. Proof. Assume that XX and YY are not equal. Let ss be the largest number in exactly one of XX and YY. Without loss of generality, say that sX\Ys \in X \backslash Y. The number fX(s)f_{X}(s) counts the sths^{\text{th}} number not in XX, which implies that
fX(s)=s+X{1,2,,fX(s)} f_{X}(s) = s + |X \cap \{1, 2, \ldots, f_{X}(s)\}|
Since fX(s)sf_{X}(s) \geq s, we have that
{fX(s)+1,fX(s)+2,}X={fX(s)+1,fX(s)+2,}Y \{f_{X}(s) + 1, f_{X}(s) + 2, \ldots\} \cap X = \{f_{X}(s) + 1, f_{X}(s) + 2, \ldots\} \cap Y
which, together with the assumption that X=Y|X| = |Y|, gives
X{1,2,,fX(s)}=Y{1,2,,fX(s)} |X \cap \{1, 2, \ldots, f_{X}(s)\}| = |Y \cap \{1, 2, \ldots, f_{X}(s)\}|
Now consider the equation
tY{1,2,,t}=s t - |Y \cap \{1, 2, \ldots, t\}| = s
This equation is satisfied only when t[fY(s),fY(s+1))t \in [f_{Y}(s), f_{Y}(s+1)), because the left hand side counts the number of elements up to tt that are not in YY. We have that the value t=fX(s)t = f_{X}(s) satisfies the above equation because of (1) and (2). Furthermore, since fX(s)Xf_{X}(s) \notin X and fX(s)sf_{X}(s) \geq s, we have that fX(s)Yf_{X}(s) \notin Y due to the maximality of ss. Thus, by the above discussion, we must have fX(s)=fY(s)f_{X}(s) = f_{Y}(s).

Finally, we arrive at a contradiction. The value fX(s)f_{X}(s) is neither in XX nor in fX(Y)f_{X}(Y), because ss is not in YY by assumption. Thus, fX(s)XYf_{X}(s) \notin X * Y. However, since sXs \in X, we have fY(s)YXf_{Y}(s) \in Y * X, a contradiction.

We are now ready to finish the proof. Note first of all that Ab=ab=Ba|A^{* b}| = ab = |B^{* a}|. Moreover, since AB=BAA * B = B * A, and * is associative, it follows that AbBa=BaAbA^{* b} * B^{* a} = B^{* a} * A^{* b}. Thus, by Lemma 2, we have Ab=BaA^{* b} = B^{* a}, as desired.

Comment 1. Taking A=XkA = X^{* k} and B=XlB = X^{* l} generates many non-trivial examples where AB=BAA * B = B * A. There are also other examples not of this form. For example, if A={1,2,4}A = \{1, 2, 4\} and B={1,3}B = \{1, 3\}, then AB={1,2,3,4,6}=BAA * B = \{1, 2, 3, 4, 6\} = B * A.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.