Conditions for level sets to be diffeomorphic to each other I have a map $\pi:\mathbb R^d\longrightarrow\mathbb R$ which is Lipschitz continuous and $\|\nabla\pi\|>0$ almost everywhere. I know also that the level set $\pi^{-1}(0)$ is compact. Can I conclude that the level sets $\pi^{-1}(c)$ are diffeomorphic for all $c\geq0$?
If not, what are the additional conditions for which I can conclude it?
Thank you
 A: As Ted Shifrin noted, you certainly have to assume there are no criticial values in $[0,\infty)$, because typically the topology of the level sets changes when you cross a critical value. But that's not sufficient.
Here's a counterexample: Consider the function $\pi\colon \mathbb R^2\to\mathbb R$ given by
$$ \pi(x,y) = \frac{ x^2 + y^2 -1}{x^2 + 1}.$$
The only criticial point of $\pi$ is the origin, which is on the level set $\pi^{-1}(-1)$, so there are no critical values in $[0,\infty)$. And $\pi^{-1}(0)$ is the unit circle, which is compact. However, $\pi^{-1}(1)$ is the pair of lines $y=\pm\sqrt{2}$, and the level sets $\pi^{-1}(c)$ for $c>1$ are hyperbolas.
One sufficient condition to guarantee that the level sets are diffeomorphic is that $\pi$ be an exhaustion function, meaning the preimage of every compact interval $[0,b]$ is compact, or equivalently that $\pi(x)\to +\infty$ as $|x|\to \infty$. The proof that the level sets are diffeomorphic in that case is (a slight modification of) a standard argument in Morse theory: Define a vector field $X = \operatorname{grad} \pi/|\operatorname{grad}\pi|^2$, and for each $t\in [0,\infty)$ let $\phi_t\colon \mathbb R^n\to \mathbb R^n$ be the flow of $X$ (wherever it's defined). A computation shows that $\pi(\phi_t(x)) = \pi(x)+t$ whenever $\phi_t(x)$ is defined. Thus as long is $t$ is in a compact interval $[0,b]$, the flow stays in the compact set $\pi^{-1}([0,b])$, which implies that the flow continues to exist for all $t\ge 0$. (This is a consequence of the Escape Lemma, which says roughly that any maximal integral curve that doesn't exist for all positive time must escape from every compact set.)  Therefore $\phi_t$ maps $\pi^{-1}(0)$ to $\pi^{-1}(t)$ diffeomorphically.
Edit: I just realized that to make this argument work, you probably need to assume more regularity than just Lipschitz. In order for the flow of $X$ to be defined, you should assume $\pi$ is locally $C^2$, or at least locally $C^{1,1}$ (continuously differentiable with locally Lipschitz derivatives).
