Olympiad Maths Prep

Track / Stage 10 / 38 of 40 #1998 of 2000

Problem 1998

Hardest shortlist tier
Algebra Difficulty 9.3 Prove it IMO2024 Shortlisted Problems · IMO

Let Q\mathbb{Q} be the set of rational numbers. Let f:QQf: \mathbb{Q} \rightarrow \mathbb{Q} be a function such that the following property holds: for all x,yQx, y \in \mathbb{Q},
f(x+f(y))=f(x)+yorf(f(x)+y)=x+f(y). f(x+f(y))=f(x)+y \quad \text{or} \quad f(f(x)+y)=x+f(y).

Determine the maximum possible number of elements of {f(x)+f(x)xQ}\{f(x)+f(-x) \mid x \in \mathbb{Q}\}.

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

Solution 1. We begin by providing an example of a function ff for which there are two values of g(x)g(x). We take the function f(x)=x{x}f(x)=\lfloor x\rfloor-\{x\}, where x\lfloor x\rfloor denotes the floor of xx (that is, the largest integer less than or equal to xx) and {x}=xx\{x\}=x-\lfloor x\rfloor denotes the fractional part of xx.
First, we show that ff satisfies P(x,y)P(x, y). Given x,yQx, y \in \mathbb{Q}, we have
f(x)+y=x{x}+y+{y}=(x+y)+({y}{x})x+f(y)=x+{x}+y{y}=(x+y)+({x}{y}) \begin{aligned} & f(x)+y=\lfloor x\rfloor-\{x\}+\lfloor y\rfloor+\{y\}=(\lfloor x\rfloor+\lfloor y\rfloor)+(\{y\}-\{x\}) \\ & x+f(y)=\lfloor x\rfloor+\{x\}+\lfloor y\rfloor-\{y\}=(\lfloor x\rfloor+\lfloor y\rfloor)+(\{x\}-\{y\}) \end{aligned}
If {x}<{y}\{x\}<\{y\}, then we have that the fractional part of f(x)+yf(x)+y is {y}{x}\{y\}-\{x\} and the floor is x+y\lfloor x\rfloor+\lfloor y\rfloor, so f(x)+yx+f(y)f(x)+y \rightarrow x+f(y). Likewise, if {x}>{y}\{x\}>\{y\}, then x+f(y)f(x)+yx+f(y) \rightarrow f(x)+y. Finally, if {x}={y}\{x\}=\{y\}, then f(x)+y=x+f(y)=x+yf(x)+y=x+f(y)=\lfloor x\rfloor+\lfloor y\rfloor is an integer. In all cases, the relation PP is satisfied.
Finally, we observe that if xx is an integer then g(x)=0g(x)=0, and if xx is not an integer then g(x)=2g(x)=-2, so there are two values for g(x)g(x) as required.
Now, we prove that there cannot be more than two values of g(x)g(x). P(x,x)P(x, x) tells us that x+f(x)x+f(x)x+f(x) \sim x+f(x), or in other words, for all xx,
f(x+f(x))=x+f(x) \begin{equation*} f(x+f(x))=x+f(x) \tag{1} \end{equation*}
We begin with the following lemma.
Lemma 1. ff is a bijection, and satisfies
f(f(x))=x \begin{equation*} f(-f(-x))=x \tag{2} \end{equation*}
Proof. We first prove that ff is injective. Suppose that f(x1)=f(x2)f\left(x_{1}\right)=f\left(x_{2}\right); then P(x1,x2)P\left(x_{1}, x_{2}\right) tells us that f(x1)+x2f(x2)+x1f\left(x_{1}\right)+x_{2} \sim f\left(x_{2}\right)+x_{1}. Without loss of generality, suppose that f(x1)+x2f(x2)+x1f\left(x_{1}\right)+x_{2} \rightarrow f\left(x_{2}\right)+x_{1}.
But f(x1)=f(x2)f\left(x_{1}\right)=f\left(x_{2}\right), so f(f(x1)+x2)=f(f(x2)+x2)=f(x2)+x2f\left(f\left(x_{1}\right)+x_{2}\right)=f\left(f\left(x_{2}\right)+x_{2}\right)=f\left(x_{2}\right)+x_{2} by (1). Therefore, f(x2)+x1=f(x2)+x2f\left(x_{2}\right)+x_{1}=f\left(x_{2}\right)+x_{2}, as required.
Now, (1) with x=0x=0 tells us that f(f(0))=f(0)f(f(0))=f(0) and so by injectivity f(0)=0f(0)=0.
Applying P(x,f(x))P(x,-f(x)) tells us that 0x+f(f(x))0 \sim x+f(-f(x)), so either 0=f(0)=x+f(f(x))0=f(0)=x+f(-f(x)) or f(x+f(f(x)))=0f(x+f(-f(x)))=0 which implies that x+f(f(x))=0x+f(-f(x))=0 by injectivity. Either way, we deduce that x=f(f(x))x=-f(-f(x)), or x=f(f(x))x=f(-f(-x)) by replacing xx with x-x.
Finally, note that bijectivity follows immediately from (2).
Since ff is bijective, it has an inverse, which we denote f1f^{-1}. Rearranging (2) (after replacing xx with x)-x) gives that f(x)=f1(x)f(-x)=-f^{-1}(x). We have g(x)=f(x)+f(x)=f(x)f1(x)g(x)=f(x)+f(-x)=f(x)-f^{-1}(x).
Suppose g(x)=ug(x)=u and g(y)=vg(y)=v, where uvu \neq v are both nonzero. Define x=f1(x)x'=f^{-1}(x) and y=f1(y)y'=f^{-1}(y); by definition, we have
xxx+uyyy+v. \begin{aligned} & x' \rightarrow x \rightarrow x'+u \\ & y' \rightarrow y \rightarrow y'+v . \end{aligned}
Putting in P(x,y)P\left(x', y\right) gives x+yx+y+vx+y \sim x'+y'+v, and putting in P(x,y)P\left(x, y'\right) gives x+yx+y+ux+y \sim x'+y'+u. These are not equal since uvu \neq v, and x+yx+y may have only one incoming and outgoing arrow because ff is a bijection, so we must have either x+y+ux+yx+y+vx'+y'+u \rightarrow x+y \rightarrow x'+y'+v or the same with the arrows reversed. Swapping (x,u)(x, u) and (y,v)(y, v) if necessary, we may assume without loss of generality that this is the correct direction for the arrows.
Also, we have xuxx-x'-u \rightarrow-x \rightarrow-x' by Lemma 1. Putting in P(x+y,xu)P\left(x+y,-x'-u\right) gives yy+vuy \sim y'+v-u, and so y+vuy'+v-u must be either y+vy'+v or yy'. This means uu must be either 0 or vv, and this contradicts our assumption about uu and vv.

Solution 2. We again start with Lemma 1, and note f(0)=0f(0)=0 as in the proof of that lemma.
P(x,f(y))P(x,-f(y)) gives x+f(f(y))f(x)f(y)x+f(-f(y)) \sim f(x)-f(y), and using (2) this becomes xyf(x)f(y)x-y \sim f(x)-f(y). In other words, either f(xy)=f(x)f(y)f(x-y)=f(x)-f(y) or xy=f(f(x)f(y))x-y=f(f(x)-f(y)). In the latter case, we deduce that
f((xy))=f(f(f(x)f(y)))f(yx)=f(f(f(x)f(y)))=f(y)f(x) \begin{aligned} f(-(x-y)) & =f(-f(f(x)-f(y))) \\ f(y-x) & =f(-f(f(x)-f(y))) \\ & =f(y)-f(x) \end{aligned}
Thus, f(y)f(x)f(y)-f(x) is equal to either f(yx)f(y-x) or f(xy)-f(x-y). Replacing yy with x+dx+d, we deduce that f(x+d)f(x){f(d),f(d)}f(x+d)-f(x) \in\{f(d),-f(-d)\}.
Now, we prove the following claim.
Claim. For any nZ>0n \in \mathbb{Z}_{>0} and dQd \in \mathbb{Q}, we have that either g(d)=0g(d)=0 or g(d)=±g(d/n)g(d)= \pm g(d / n).
In particular, if g(d/n)=0g(d / n)=0 then g(d)=0g(d)=0.
Proof. We first prove that if g(d/n)=0g(d / n)=0 then g(d)=0g(d)=0. Suppose that g(d/n)=0g(d / n)=0. Then f(d/n)=f(d/n)f(d / n)=-f(-d / n) and so f(x+d/n)f(x)=f(d/n)f(x+d / n)-f(x)=f(d / n) for any xx. Applying this repeatedly, we deduce that f(x+d)f(x)=nf(d/n)f(x+d)-f(x)=n f(d / n) for any xx. Applying this with x=0x=0 and x=dx=-d and adding gives f(d)+f(d)=0f(d)+f(-d)=0, so g(d)=0g(d)=0, and in particular the claim is true whenever g(d)=0g(d)=0.
Now, select nZ>0n \in \mathbb{Z}_{>0} and dQd \in \mathbb{Q} such that g(d)0g(d) \neq 0, and observe that we must have g(d/n)0g(d / n) \neq 0. Observe that for any kZk \in \mathbb{Z} we have that f(kd/n)f((k1)d/n){f(d/n),f(d/n)}f(k d / n)-f((k-1) d / n) \in\{f(d / n),-f(-d / n)\}. Let AiA_{i} be the number of kZk \in \mathbb{Z} with in<kii-n<k \leqslant i such that this difference equals f(d/n)f(d / n).
We deduce that for any iZi \in \mathbb{Z},
f(id/n)f(id/nd)=in<kif(kd/n)f((k1)d/n)=Aif(d/n)(nAi)f(d/n)=nf(d/n)+Aig(d/n) \begin{aligned} f(i d / n)-f(i d / n-d) & =\sum_{i-n<k \leqslant i} f(k d / n)-f((k-1) d / n) \\ & =A_{i} f(d / n)-\left(n-A_{i}\right) f(-d / n) \\ & =-n f(-d / n)+A_{i} g(d / n) \end{aligned}
Since g(d/n)g(d / n) is nonzero, this is a nonconstant linear function of AiA_{i}. However, there are only two possible values for f(id/n)f(id/nd)f(i d / n)-f(i d / n-d), so there must be at most two possible values for AiA_{i} as ii varies. And since Ai+1Ai{1,0,1}A_{i+1}-A_{i} \in\{-1,0,1\}, those two values must differ by 1 (if there are two values).
Now, we have
f(d)f(0)=nf(d/n)+Ang(d/n),andf(0)f(d)=nf(d/n)+A0g(d/n) \begin{aligned} f(d)-f(0) & =-n f(-d / n)+A_{n} g(d / n), \quad \text{and} \\ f(0)-f(-d) & =-n f(-d / n)+A_{0} g(d / n) \end{aligned}
Subtracting these (using the fact that f(0)=0f(0)=0 ) we obtain
f(d)+f(d)=(AnA0)g(d/n)=±g(d/n) \begin{aligned} f(d)+f(-d) & =\left(A_{n}-A_{0}\right) g(d / n) \\ & = \pm g(d / n) \end{aligned}
where the last line follows from the fact that g(d)g(d) is nonzero.
It immediately follows that there can only be one nonzero number of the form g(x)g(x) up to sign; to see why, if g(d)g(d) and g(d)g\left(d'\right) are both nonzero, then for some n,nZ>0n, n' \in \mathbb{Z}_{>0} we have d/n=d/nd / n=d'/ n'. But
g(d)=±g(d/n)=±g(d) g(d)= \pm g(d / n)= \pm g\left(d'\right)
Finally, suppose that for some d,dd, d' we have g(d)=cg(d)=c and g(d)=cg\left(d'\right)=-c for some nonzero cc. So we have
f(d)+f(d)f(d)f(d)=2c f(d)+f(-d)-f\left(d'\right)-f\left(-d'\right)=2 c
which rearranges to become (f(d)f(d))(f(d)f(d))=2c\left(f(d)-f\left(d'\right)\right)-\left(f\left(-d'\right)-f(-d)\right)=2 c.
Each of the bracketed terms must be equal to either f(dd)f\left(d-d'\right) or f(dd)-f\left(d'-d\right). However, they cannot be equal since cc is nonzero, so g(dd)=f(dd)+f(dd)=±2cg\left(d-d'\right)=f\left(d-d'\right)+f\left(d'-d\right)= \pm 2 c. This contradicts the assertion that g(x)=±cg(-x)= \pm c for all xx.

Solution 3. As in Solution 1, we start by establishing Lemma 1 as above, and write f1(x)=f(x)f^{-1}(x)= -f(-x) for the inverse of ff, and g(x)=f(x)f1(x)g(x)=f(x)-f^{-1}(x).
We now prove the following.
Lemma 2. If g(x)g(y)g(x) \neq g(y), then g(x+y)=±(g(x)g(y))g(x+y)= \pm(g(x)-g(y)).
Proof. Assume xx and yy are such that g(x)g(y)g(x) \neq g(y). Applying P(x,f1(y))P\left(x, f^{-1}(y)\right) gives x+yf(x)+f1(y)x+y \sim f(x)+f^{-1}(y), and applying P(f1(x),y)P\left(f^{-1}(x), y\right) gives x+yf1(x)+f(y)x+y \sim f^{-1}(x)+f(y).
Observe that
(f(x)+f1(y))(f1(x)+f(y))=(f(x)f1(x))(f(y)f1(y))=g(x)g(y) \begin{aligned} \left(f(x)+f^{-1}(y)\right)-\left(f^{-1}(x)+f(y)\right) & =\left(f(x)-f^{-1}(x)\right)-\left(f(y)-f^{-1}(y)\right) \\ & =g(x)-g(y) \end{aligned}
By assumption, g(x)g(y)g(x) \neq g(y), and so f(x)+f1(y)f1(x)+f(y)f(x)+f^{-1}(y) \neq f^{-1}(x)+f(y). Since ff is bijective, this means that these two values must be f(x+y)f(x+y) and f1(x+y)f^{-1}(x+y) in some order, and so g(x+y)=f(x+y)f1(x+y)g(x+y)=f(x+y)-f^{-1}(x+y) must be their difference up to sign, which is either g(x)g(y)g(x)-g(y) or g(y)g(x)g(y)-g(x).
Claim. If xx and qq are rational numbers such that g(q)=0g(q)=0 and nn is an integer, then g(x+nq)=g(x)g(x+n q)= g(x).
Proof. If g(b)=0g(b)=0 and g(a)g(a+b)g(a) \neq g(a+b), then the lemma tells us that g(b)=±(g(a+b)g(a))g(b)= \pm(g(a+b)-g(a)), which contradicts our assumptions. Therefore, g(a)=g(a+b)g(a)=g(a+b) whenever g(b)=0g(b)=0.
A simple induction then gives that g(nb)=0g(n b)=0 for any positive integer nn, and g(nb)=0g(n b)=0 for negative nn as g(x)=g(x)g(x)=g(-x). The claim follows immediately.
Lemma 3. There cannot be both positive and negative elements in the range of gg.
Proof. Suppose that g(x)>0g(x)>0 and g(y)<0g(y)<0. Let S\mathcal{S} be the set of numbers of the form mx+nym x+n y for integers m,nm, n. We first show that g(S)g(\mathcal{S}) has infinitely many elements. Indeed, suppose g(S)g(\mathcal{S}) is finite, and let aSa \in \mathcal{S} maximise gg and bSb \in \mathcal{S} maximise g-g. Then a+bSa+b \in \mathcal{S}, and g(a+b)=g(a)g(b)g(a+b)=g(a)-g(b) or g(b)g(a)g(b)-g(a). In the first case g(a+b)>g(a)g(a+b)>g(a) and in the second case g(a+b)<g(b)g(a+b)<g(b); in either case we get a contradiction.
Now, we show that there must exist some nonzero rational number qq with g(q)=0g(q)=0. Indeed, suppose first that a+f(a)=0a+f(a)=0 for all aa. Then g(a)=f(a)+f(a)=0g(a)=f(a)+f(-a)=0 for all aa, and so gg takes no nonzero value. Otherwise, there is some aa with a+f(a)0a+f(a) \neq 0, and so (1) yields that f(q)=0f(q)=0 for q=a+f(a)0q=a+f(a) \neq 0. Noting that f(q)=0f(-q)=0 from Lemma 1 tells us that g(q)=0g(q)=0, as required.
Now, there must exist integers ss and ss' such that xs=qsx s=q s' and integers tt and tt' such that yt=qty t=q t'. The claim above gives that the value of g(mx+ny)g(m x+n y) depends only on the values of mmodsm \bmod s and nmodtn \bmod t, so g(mx+ny)g(m x+n y) can only take finitely many values.
Finally, suppose that g(x)=ug(x)=u and g(y)=vg(y)=v where uvu \neq v have the same sign. Assume u,v>0u, v>0 (the other case is similar) and assume u>vu>v without loss of generality.
P(f1(x),f1(y))P\left(f^{-1}(x), f^{-1}(y)\right) gives xyf1(x)f1(y)=f(x)f(y)(uv)x-y \sim f^{-1}(x)-f^{-1}(y)=f(x)-f(y)-(u-v), and P(x,y)P(x, y) gives xyf(x)f(y)x-y \sim f(x)-f(y). uvu-v is nonzero, so f(xy)f(x-y) and f1(xy)f^{-1}(x-y) must be f(x)f(y)(uv)f(x)-f(y)-(u-v) and f(x)f(y)f(x)-f(y) in some order, and since g(xy)g(x-y) must be nonnegative, we have
f(x)f(y)(uv)xyf(x)f(y). f(x)-f(y)-(u-v) \rightarrow x-y \rightarrow f(x)-f(y) .
Then, P(xy,f1(y))P\left(x-y, f^{-1}(y)\right) tells us that (xy)+y(f(x)f(y))+(f(y)v)(x-y)+y \sim(f(x)-f(y))+(f(y)-v), so xf(x)vx \sim f(x)-v, contradicting either vuv \neq u or v>0v>0.

Answer: 2 is the maximum number of elements.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.