# A question of rationality

This problem was asked to me by a friend and I simply have no idea about it. So I have not progressed a single bit. The problem is this: If $f :\mathbb{R}\to \mathbb{R}$ is an infinitely differentiable function and $f(x)\in\mathbb{Q} \;\forall x\in\mathbb{Q}$ then must $f'(x)$ be rational for all rational $x$ ?

• $\mathbb{Q}$ is not complete (a sequence of rational numbers might converge to $\sqrt{2}$, for instance). Incremental quotients of $f$ are rational for rational increments, but their limit needn't be. This is my feeling. Apr 22, 2014 at 12:42
• @Siminore Yup, my intuition says "no", too. The question is, how does one prove that? Even if you restrict yourself to analytic functions, this isn't easy. One can probably show that if all the coefficient $c_k$ are rational and positive, then $\sum_{k=1}^\infty c_k x^k$ is only rational for all $x$ if only finitely many of the $c_k$ are non-zero. But who says you couldn't have irrational $c_k$ for which the sum nevertheless turns out rational for rational $x$? And if you allow negative $c_k$, couldn't the positive and negative sum's irrationalities cancel out?
– fgp
Apr 22, 2014 at 12:49
• Yes that's my point too what fgp tried to say. Any rigorous method would be welcome. Thanks in advance for the help. Apr 22, 2014 at 12:51
• There may be something helpful at math.stackexchange.com/questions/167620/… and also at mathoverflow.net/questions/48910/… Apr 22, 2014 at 12:54

Let's first construct a function $f \,:\, \mathbb{R} \to \mathbb{R}$ with $f(\mathbb{Q}) \subset \mathbb{Q}$ which is derivable at a single point $x_0$ with $f'(x_0) \notin \mathbb{Q}$.

Let $q_n$ be some rational approximation of an irrational number $a$, i.e. for example let $q_n \in \mathbb{Q}$ with $\lim_{n\to\infty} q_n = \sqrt{2}$. Then take the piecwise constant function $f \,:\, \mathbb{R} \to \mathbb{Q}$ defined by $$f(x) = \begin{cases} \frac{q_n}{n} &\text{if x \in \left[\tfrac{1}{n},\tfrac{1}{n-1}\right) for some n\in\mathbb{N},} \\ \frac{-q_n}{n} &\text{if x \in \left(\tfrac{-1}{n+1},\tfrac{-1}{n}\right] for some n\in\mathbb{N},} \\ 0 &\text{if x = 0} \end{cases}$$ (For $x \geq 1$, this is to be read as $x \in [1,\infty)$, i.e. $n=1$ in this case). Since we even have $f(\mathbb{R}) \subset \mathbb{Q}$, obviously also $f(\mathbb{Q}) \subset \mathbb{Q})$, thus fullfilling our requirement.

Being a step function, $f$ is of course not differentiable on $\frac{1}{n}$ in general. However, at $0$, we have $$f'(0) = \lim_{x \to 0} \frac{f(x) - f(-x)}{2x} = \lim_{n\to\infty} \frac{f(\tfrac{1}{n}) - f(\tfrac{-1}{n})}{\tfrac{2}{n}} = \lim_{n\to\infty} \frac{\tfrac{q_n}{n} - \tfrac{-q_n}{n}}{\tfrac{2}{n}} = \lim_{n\to\infty} q_n = \sqrt{2} \notin \mathbb{Q}\text{,}$$ meaning that $f'(0)$ does indeed exist, yet doesn't take a rational value. (Note that to force the limit to exists for all sequences $x_n \to 0$, not just $x_n = \left(\tfrac{1}{n}\right)$, it might be necessary to require $q_n$ to converge sufficiently fast)

To make $f$ differentiable everywhere, we're going to have to get rid of the steps, i.e. somehow smoothen the $f$ constructed above. For that, we can use polynomial interpolation. Let's assume $q_n \to \sqrt{2}$ monotonically from above. If we can find polynomials $p_n$, $n \in \mathbb{N}$, with $$\begin{eqnarray} p_n\left(\tfrac{1}{n}\right) &=& \frac{q_n}{n} \\ p_n\left(\tfrac{1}{n-1}\right) &=& \frac{q_{n-1}}{n-1} \\ p'_n\left(\tfrac{1}{n}\right) &=& q_{n} \\ p'_n\left(\tfrac{1}{n-1}\right) &=& q_{n-1} \\ p'_n\left(\left[\tfrac{1}{n}, \tfrac{1}{n-1}\right]\right) &\subset& [q_{n}, q_{n-1}] \end{eqnarray}$$ then we can simply set $$f(x) = \begin{cases} p_n(x) &\text{if x \in \left[\tfrac{1}{n},\tfrac{1}{n-1}\right) for some n\in\mathbb{N},} \\ -p_n(-x) &\text{if x \in \left(\tfrac{-1}{n+1},\tfrac{-1}{n}\right] for some n\in\mathbb{N},} \\ 0 &\text{if x = 0.} \end{cases}$$ Again, $\lim_{x\to a}\frac{f(x) - f(-x)}{2x} = \lim_{n\to\infty} q_n$ if the first limit exists at all. The conditions imposed on $p'_n$ ought to ensure that it does.

Unfortunately, though, this idea still only yields a function that is differentiable once, and it's not clear whether it can be extended to yield an $f \in C^\infty$. Piecewise polynomial functions won't work for that, I fear.

• But this $f$ is not infinitely differentiable. Apr 22, 2014 at 14:47
• @OmranKouba I'd love to give a full answer, but I figured a partial answer is better than none. Maybe someone else can use this as a starting point.
– fgp
Apr 22, 2014 at 15:27