Double limit of $\cos^{2n}(m! \pi x)$ at rationals and irrationals I stumbled upon this "relation" (is the name correct?):
$$
\lim_{m \to \infty} \lim_{n \to \infty} \cos^{2n}(m! \pi x) = \begin{cases}
1,&x\text{ is rational}\\
0,&x\text{ is irrational}\end{cases}
$$
How is it called and why is it so? I'm really not asking for a proof since I fear it would be too complicated for me to understand, but rather for an "intuition".

The intuition is already almost the proof.


*

*The cosine takes values between $-1$ and $1$, inclusive

*Taking an even power ensures that the values are between $0$ and $1$.

*Taking higher and higher powers will not affect those $x$ where the cosine squared is $1$, but all other values will converge to $0$


Thus $f(x):=\lim_{n\to\infty}\cos^{2n}(x)$ is a function that has value $0$ for all $x$, except that $f(x)=1$ if $\cos(x)=\pm1$, i.e. if $x$ is a multiple of $\pi$.
After this, we see that multiplying the argument with $\pi$ is done to have the value $1$ at integers instead of multiples of $\pi$. Then the multiplication with $m!$ serves the purpose to obtain $1$ for any integer multiple of $\frac1{m!}$. As $m\to \infty$, this exhausts the rationals (and only them).
