Let $f$ be a real analytic map from $\mathbb{R}^n$ to $\mathbb{R}^m$ where $n<m$. Can we say image of $f$ is not dense in $\mathbb{R}^m$? I know this is not true for $C^0$ or $C^1$ maps.
2 Answers
The answer is no. Below I construct an analytic function $f:\mathbb R \rightarrow \mathbb R^2$ with dense image. Note, that this does not contradict Sard's theorem, since it only implies that the image has zero measure and does not say anything about density.
I was not able to come up with an example that is given by a simple formula, but it should be noted that if we replace real vector spaces with arbitrary analytic manifolds $N$ and $M$ with dimensions $n < m$ and ask the same question, then there are well-known classical examples. For instance, almost all geodesics on a torus are dense.
We start from a real analytic function $\phi:\mathbb R \rightarrow [-1,1]^2$ with dense image. It can be easily constructed as $$\phi(t) = (\phi_1(t), \phi_2(t)) = (\sin(\alpha t), \sin(\beta t)),$$ where $\alpha, \beta \in \mathbb R\setminus \{0\}$ and $\alpha / \beta$ is irrational.
Now let $S \subset \mathbb R^3$ denote the unit sphere. Using $\phi$ we define a real analytic function $\psi:\mathbb R \rightarrow S$ with dense image. It just maps $t$ to a point on a sphere that has spherical coordinates $\pi \phi_1(t)$ and $\pi(\phi_2(t) + 1)/2$. From the formulas that map spherical coordinates onto $S$ it is clear that $\psi$ is real analytic.
Finally, we note that, since $\psi$ is analytic, its image (by Sard's theorem, for instance) does not coincide with $S$. Moreover, if $x \in S$, then there is a real analytic diffeomorphism $p_x$ from $S \setminus \{x\}$ to $\mathbb R^2$ given by the stereographic projection. The function in question now can be constructed as $p_x \circ \psi$, where $x \in S$ is taken outside the image of $\psi$.
EDIT. A deleted answer to this question also gave me another insight into this problem. Namely, given any map $c:\mathbb Z \rightarrow \mathbb R$ there exists a real analytic function $f:\mathbb R \rightarrow \mathbb R$ that extends $c$. Using this and arbitrary dense sequence in $\mathbb R^n$ you can construct a real analytic function $f:\mathbb R\rightarrow \mathbb R^n$ such that $f(\mathbb Z)$ is dense.
I suppose, there are many ways to prove the statement above. I prefer complex analytic arguments that allow to construct a function $f$ with prescribed values on integers even with the additional constraint that f is an entire complex analytic function. The proof goes along the lines of the Mittag-Leffler theorem. See this post, for instance: Entire function with prescribed values
No. Let's consider the case $n=1$. Let $x_j$ be a sequence that is dense in $\mathbb R^n$. We can assume $|x_j| < j$ for all $j$. Then there is a real-analytic map $f: \mathbb R \to \mathbb R^n$ such that $f(n) = x_n$ for all positive integers $n$. In fact we can assume $f$ is analytic on the strip $U = \{z \in \mathbb C: |\text{Im}(x)| < 1\}$. We can define it as
$$f(x) = \sum_{n=1}^\infty x_n g_n(x-n)$$ where $g_n(z) = \frac{\sin(\pi z)}{\pi z} \exp(-n z^2) $ for $z \ne 0$, $g_n(0) = 1$. Note that $g_n(z)$ is an entire function (the singularity at $0$ being removable), and for $|\text{Im }(z)|<1$ we have $|g_n(z)| < 4 \exp(n - n (\text{Re }z)^2))$ This is enough to conclude that the series $\sum_{n=1}^\infty x_n g_n(z-n)$ converges uniformly on compact subsets of $U$, so that $f$ is analytic there.