TITLE: The Hausdorff dimension of the zero set of a real analytic function
QUESTION [5 upvotes]: Let $n>1$, and let $f:\mathbb{R}^n \to \mathbb{R}$ be a real-analytic function which is not identically zero. 
Does $\dim_{\mathcal H}(f^{-1}(0)) \le n-1$? here $\dim_{\mathcal H}$ refers to the Hausdorff dimension. (I have read this claim in a paper, but there was no reference).
I know that $f^{-1}(0)$ has Lebesgue measure zero.
If this is false, is it true then that $\dim_{\mathcal H}(f^{-1}(0)) < n$?
Any reference would be appreciated.

REPLY [4 votes]: I would like to propose an elementary approach based on the implicit function theorem.
Consider $F_0=f^{-1}(0)$. By the implicit function theorem if $\nabla f(x)\neq 0$ for some $x\in F_0$ then $F_0$ is a graph locally around $x$ and thus of dimension $n-1$ (actually a smooth submanifold).
Consider then the exceptional set $F_1=\{x:f(x)=0\wedge \nabla f(x)=0\}$. If $\nabla^2 f(x)\neq 0$ for some $x\in F_1$ then in particular $\nabla (\partial_i f)(x)\neq 0$ for some $i\in \{1,\ldots ,n\}$ and thus $F_1\subset \{x:\partial_if(x)=0\}$ which is a graph locally around $x$ and thus of dimension $n-1$.
The exceptional set is now $F_2=\{x:f(x)=0\wedge \nabla f(x)=0\wedge \nabla^2 f(x)=0\}$. Continuing this way the exceptional set $F_k$ where all derivatives up to order $k$ vanish is contained in a smooth submanifold of dimension $n-1$. What remains is the set of those points where all derivatives of all orders vanish, which is empty by assumption (otherwise by analyticity the function is identically zero).