Let $f:\mathbb{R}^d\to \mathbb{R}$ be real analytic. Define $S=\{x\in\mathbb{R}^d, \nabla f (x)=0\} $. Is it true that for any compact set $K\subset \mathbb{R}^d$, $f(S\cap K)$ is a finite set ?

2$\begingroup$ I am probably missing something, but could the downvoters explain their vote? The answer doesn't seem trivial to me. $\endgroup$ – abx Aug 29 '17 at 16:22
One can assume that $K$ is a cube, by enlarging it. Then $S \cap K$ is a bounded definable set in the $o$minimal structure $\mathbb{R}^{\mathrm{an}}$ (obtained by adding restricted analytic function, cf this paper).
By the YomdinGromov parametrization lemma, there exists a finite family $(\phi_i : ]0,1[^{d_i} \rightarrow S \cap K)_{i \in I}$ of differentiable functions whose images cover $S \cap K$.
For each $i$, the function $f \circ \phi_i$ is differentiable with vanishing differential, so that $f \circ \phi_i = c_i$ for some constant $c_i$. Thus $f(S \cap K) \subseteq \{ c_i \  \ i \in I \}$ is a finite set.
EDIT: I just realized one could avoid the use of the YomdinGromov parametrization lemma. Namely, $f(S \cap K)$ is a definable subset of $\mathbb{R}$ wrt the aforementioned ominimal structure. It is therefore a finite union of points and intervals. Since it has zero Lebesgue measure by MorseSard's theorem, it must consist of finitely many points.

$\begingroup$ Thank you for the answer. I just need to see the definition of $o$minimal structure because I am not familiar with this notion. Do you think the result would extend to the case of a function piecewise analytic (i.e defined on $\mathbb{R}^d\setminus \mathcal{C}$ where $\mathcal{C}$ is a (semi)analytic surface ? ) $\endgroup$ – Chr Aug 30 '17 at 11:36

$\begingroup$ It works for any $C^1$ function which is definable in some $o$minimal structure. It is not the case e.g. for $x \mapsto \sin(1 / x)$ if $x \neq 0$. $\endgroup$ – js21 Aug 30 '17 at 13:36

$\begingroup$ So I need to check that a piecewise analytic function is definable in some ominimal structure. I am not familiar with the usual proofs, would you recommand a reference ? Thanks $\endgroup$ – Chr Aug 30 '17 at 14:01

$\begingroup$ A standard reference is cambridge.org/core/books/tametopologyandominimalstructures/…. Francois Loeser, who has a few papers in the field, gave a course on ominimal theory a few years ago in Paris 6, and notes were taken (in french), which can serve as a gentler introduction (sect. 25): eleves.ens.fr/home/guignard/pdf/ominimal.pdf. $\endgroup$ – js21 Aug 30 '17 at 15:25

$\begingroup$ I read the references but I still don't know if the result still holds for functions $f $ that are real analytic on some bounded connected open set. In the references you mentioned, the analytic functions are restricted to a cube. $\endgroup$ – Chr Sep 7 '17 at 14:24
Yes. For another approach, see "MorseSard theorem for realanalytic functions" by Jiří Souček and Vladimír Souček. (Commentationes Mathematicae Universitatis Carolinae, Vol. 13 (1972), No. 1, 4551)