\(\def\Real{\mathbb{R}}\)

Consider a Morse function on \(f:\Real^n\to \Real\) with controlled behavior at infinity, – say, \(f=|x|^2\) near infinity. Assume further that all critical values \(a_1<a_2<\ldots<a_k\) are distinct and that all indices of critical points are \(0\) or \(1\). (Condition obviously holds in one variable.)

Clearly, there are many function that satisfy these conditions. In the (again, most transparent) univariate case, the enumeration of topological types of functions with given critical values is the subject of a nice thread of papers by Arnold on “*snakes*” (see, e.g., here), relating them to enumeration of ramified coverings of Riemannian spheres, up-down sequences and other cute objects.…