# Well-definedness of a certain function defined on the rationals

Let $$A$$ be an irrational, countable dense subset of $$[0,1]$$, e.g, $$A=\{q\sqrt 2|q\in\mathbb Q\} \cap[0,1]$$. Let $$\{a_i\}_{i\in \mathbb N} =A$$ be an enumeration of $$A$$. Let $$f:\mathbb Q\cap[0,1] \to \mathbb R$$ be defined by:

$$f(x)=\sum_{i\in\mathbb N} \frac{\varepsilon_i}{|x-a_i|}.$$

Can the sequence $$\{\varepsilon_i\}_{i\in\mathbb N}$$ be chosen such that $$f$$ is well-defined at every point, i.e., the sum is finite?

I came up with this example in trying to construct a continuous function on a dense subset of the unit interval that has no continuous (domain) extension to any neighbourhood (in the unit interval) of any point, but I don’t know how to make to ensure it is well-defined

• I suppose you want $\epsilon_i>0$ for each $i$ as well. Mar 15, 2023 at 0:19
• I am not sure why this is of relevance Mar 15, 2023 at 13:06

Yes. Enumerate $$\mathbb{Q}\cap[0,1]$$ as $$\{q_i\}_{i\in\mathbb{N}}$$. Now choose $$\epsilon_i>0$$ such that $$\frac{\epsilon_i}{|q_j-a_i|}<1/2^i$$ for all $$j\leq i$$ (which is possible since there are only finitely many such $$j$$ for each given $$i$$). Then for any fixed $$j$$, the terms in $$f(q_j)$$ will all be less than $$1/2^i$$ for all $$i\geq j$$, and so the sum will converge.
(Note, though, that the convergence will not be uniform, so there is no reason to expect $$f$$ to be continuous. In fact, such an $$f$$ can never be continuous, since it must approach $$\infty$$ as you approach any point of $$A$$, so it is unbounded on every open interval. To get a function that is continuous, you can use a similar construction but using summands that have a jump discontinuity at each $$a_i$$ rather than blowing up to $$\infty$$, so that each summand will be bounded and the sum can converge uniformly.)
• Thanks for your answer. I can’t see why it’s true that “[Then] for any fixed $j$, the terms in $f(q_j)$ will all be less than $1/2^i$ for all $i\geq j$”. Shouldn’t this be $i\le j$? Mar 15, 2023 at 1:26
• I thought about the jump discontinuity, for example by replacing the summands by $\mathcal H(x-a_i) \varepsilon_i$, using Heaviside functions, but I would have to think through this example though Mar 15, 2023 at 1:34
• The fact that it approaches infinity shouldn’t take away from its continuity per se, $f(x) = \frac{1}{x-\sqrt 2}$ is continuous on the rationals and approaches infinity as you approach $\sqrt 2$ Mar 15, 2023 at 1:37
• No, it is for $i\geq j$. The variables $i$ and $j$ play the same role as they did in the previous sentence (where it was $j\leq i$), just now we are thinking about $j$ being fixed instead of $i$ being fixed. Mar 15, 2023 at 2:01