The Dirichlet function $d : [0,1] \to \mathbb R$, being equivalent to the limit $$\lim_{n\to\infty}\lim_{m\to\infty} \cos^{2m}(n! \pi x), \qquad x \in [0,1], $$ is a perfect example of a "horrible" function that is given as the limit of the sequence of "beautiful" functions such as $f_{(n,m)}(x) = \cos^{2m}(n!\pi x)$, the problem being that the convergence is only pointwise and not uniform. However the sequence of these cosines is parametrized by two integer values instead of one, which is the most usual setting when treating sequences of functions. Ideally, with a single index I can easily conclude, by the usual theory of functional sequences, that this is a nice example of a sequence of functions that are integrable, continuous etc., which converge to a limit that is neither.
My idea is that this can be resolved by establishing an order on the lattice $L$ of integer couples $(n,m)$ with $n,m > 0$, seen as a subset of (the first quadrant of) $\mathbb R^2$, for example in this way:
- For all $\rho > 0$, consider the circumference $C_\rho = \{(x,y) \in \mathbb R^2\ : x^2 + y^2 = \rho^2 \}$; in general, this circumference will not contain any points in $L$, unless $\rho$ is of the form $\rho_k^2 = k$, for a nonzero $k \in \mathbb N$; for example, if $k = 2$, $C_{\rho_k} = C_{\sqrt 2} \ni (1,1)$. However, not every $k$ corresponds to a circumference containing a point in $L$, as is the case of $k = 3$. As can be seen from the definition of $C_\rho$, the necessary and sufficient condition is that $k$ be decomposable as the sum of two perfect squares: so $65$ is a valid value of $k$ because $65 = 49 + 16$. Therefore we may extract these special integers from $\mathbb N$ and induce over them the standard ordering of $\mathbb N$ by forging the sequence $\{k_p\} = \{2,5,8,10,13,17,18,\dots \}$ parametrized by $p \in \mathbb N$ (OEIS A000404), so that e.g. $65 = k_{23}$. Notice that this also induces an ordering in the set of "valid" circumferences $\{C_{\rho_{k_p}} =: \Gamma_p,\ p\in\mathbb N\}$, namely $$\Gamma_p \preccurlyeq \Gamma_q \quad \iff \quad p \leq q$$
- Now, for each circumference of the type $\Gamma_p$, we are sure that at least one point in $L$ is an element of $\Gamma_p$; however, there are instances of circumference that contain more than one point in $L$, so that the ordering $\preccurlyeq$ would not be a total ordering over $L$. For example $(1,2)$ and $(2,1)$ would not be comparable according to $\preccurlyeq$, since they are both elements of $\Gamma_2 = C_{\sqrt 5}$. This can be resolved by extending $\preccurlyeq$ in such a manner that, if $(a,b),(a',b') \in \Gamma_p$ for some $p$, $$(a,b) \preccurlyeq (a',b') \quad \iff \quad b \leq b'.$$ Intuitively, this means that a point $(a,b)$ precedes $(a',b')$ in the same circumference $\Gamma_p$ iff it is encountered earlier when traveling along $\Gamma_p$ from the $x$-axis in the counterclockwise sense.
- In total, we have found the total ordering $$(1,1) \prec (2,1) \prec (1,2) \prec (2,2) \prec (3,1) \prec (1,3) \prec (3,2) \prec (2,3) \prec \cdots$$ and we may generate the sequence $\{a_i\}$ given inductively-recursively by $$a_1 = (1,1), \qquad a_{i+1} = \inf\left\{(n,m) \in L\ |\ a_i \prec (n,m) \right\}. $$ By construction, for all $M > 0$ there will always be an index $j$ such that, for all $i \geq j$, $|a_i|^2 > M$, i.e. the sequence $\{a_i\}$ is unbounded; but since $|a_i|^2 = |(n,m)|^2$ for some positive integers $n,m$, this means $n^2 + m^2 > M$. Now let $g_i : [0,1] \to \mathbb R$ such that $$ g_i(x) = f_{a_i}(x) = \cos^{2m}(n!\pi x), \qquad \text{with}\ n,m\ \text{such that}\ (n,m) = a_i.$$
At this point, I would like to prove that $\lim_{i \to\infty} g_i(x) = d(x)$ for all $x \in [0,1]$. Observe that whenever $x = p/q$, $\cos^{2m}(n!\pi x) = 1$ for all $m$, and for all $n > q$; therefore, if $|a_i|^2=|(n,m)|^2$ is sufficiently large (larger than $q^2+1$), $g_i(x) = f_{a_i}(x)$ is equal to $1$. Now the case $x \notin \mathbb Q$ has me stuck: if I fix $n$, then as $m$ grows the value $f_{(n,m)}(x)$ tends to zero, while if $m$ is fixed and $n$ grows it seems to oscillate, so I cannot easily desume a general behavior of $g_i$ as $i$ grows.
- Is my reasoning (up to the last sentence) correct? Can it be improved?
- If ever, can it be completed?
- If it is wrong, does there exist another way to reduce the double limit to a single limit?