The Morse functions are dense in $C^\infty(M)$, and you can ask if a 1-parameter family of smooth functions between two given Morse functions will be a homotopy through Morse functions. Well, Cerf Theory shows that there is a codimension-one stratum $\mathcal{F}^1$ in $C^\infty(M)$, and so any path between two Morse functions will transversely intersect $\mathcal{F}^1$ a finite number of times (in a few specific ways).


**Can we somehow 'measure' how far away a given function is from $\mathcal{F}^1$?**


(Cerf's $\mathcal{F}^1$ consists of two components: the set of smooth functions that have exactly one birth point and distinct critical values, and the set of Morse functions where exactly two distinct critical points have the same value. A birth/death point of a smooth function on an $n$-manifold is a point with local neighborhood $-x\_1^2-\cdots-x^2\_i+x\_{i+1}^2+\cdots+x^2\_n+x^3\_{n+1}$. The codimension-zero stratum $\mathcal{F}^0$ is essentially the space of Morse functions, but only the ones with distinct critical values. This separation is slightly weird to me.)



Concerning strata in $C^\infty(M)$
For completeness I will write the comments here, to close the question.


Given $f\in C^\infty(M)$, in relation to the given stratum $\mathcal{F}^1$ it might be hard to measure distance because we want to detect when the function has *precisely one* birth point or has *precisely one* pair of critical points with identical values (the strata is explained nicely in Hatcher-Wagoner's book on the subject). But if we ignore this "precisely one birth or pair" condition (by perturbing from higher codimension strata), then


the distance can be $f\mapsto \min\_{p\in crit(f)}|\det(Hess(f,p))|\cdot\inf\_{p\ne q\in crit(f)}|f(p)-f(q)|$


Here the first factor checks for birth points, and the second factor checks for distinct critical points with identical values. If we further want to consider the stratum which doesn't contain Morse functions (so that we only worry how far away $f$ is from giving birth to / killing a critical point), then we can drop the second factor.


