# Morse functions are dense in $\mathcal{C}^\infty(X,\mathbb{R})$.

In Shastri's Elements of Differential Topology, p.210-211, there is written:

Why do we get a Morse function $f_u$ on $X$? We know that for any $f\!\in\!\mathcal{C}^\infty(X,\mathbb{R})$, there is some $a\!\in\!\mathbb{R}^N$, such that $f_a(x)=f(x)\!+\!\langle x,a\rangle$ is a Morse function on $X$. Since $X$ is compact, the function $|\langle\_,a\rangle|$ attains its maximal value on $X$. Then, we define $$b := \frac{a\varepsilon}{\max_{x\in X}|\langle x,a\rangle|},$$ and we have $\sup_{x\in X}|f\!-\!f_b|=\sup_{x\in X}|\langle x,b\rangle|=\frac{\sup_{x\in X}|\langle x,a\rangle|}{\max_{x\in X}|\langle x,a\rangle|}\varepsilon=\varepsilon$. But why is this $f_b$ a Morse function on $X$? Its differential is $D(f_b)_p=D(f)_p+b$, so $p\!\in\!X$ is a critical point iff $D(f)_p\!=\!-b\!=\!-\frac{a}{\ldots}$. On the other hand, the critical points of $f_a$ are those for which $D(f)_p\!=\!-a$. I do not see how to make a conclusion here.

-
Ah, by compactness of $X$, the function $\|x\|$ is bounded on $X$, and there exists $$a\!\in\!\mathbb{B}^N(0,\frac{\varepsilon}{\max_{x\in X}\|x\|}),$$ for which $f_a$ is a Morse function. Then $$\sup_{x\in X}|f(x)\!-\!f_a(x)|= \sup_{x\in X}|\langle x,a\rangle|\leq \sup_{x\in X}|\|x\|\|a\|\leq \varepsilon.$$ Sorry for asking unnecessarily. –  Leon Lampret Aug 26 '12 at 0:30
You can answer your own question so that the post is useful to someone else. –  leo Aug 26 '12 at 0:39
Ok. But that segment from the book is confusing, or am I wrong? Why would we need $|\langle x,a\rangle|\leq\varepsilon$? What was the author's original argument? –  Leon Lampret Aug 26 '12 at 0:43
@LeonLampret The conclusion of Remark 8.1.2 reads not as "we get a Morse function", but "we get a Morse function such that $\dots<\epsilon$". So it seems that the author will need this $<\epsilon$ elsewhere. –  user31373 Aug 26 '12 at 1:24
By compactness of $X$, the function $\|x\|$ is bounded on $X$, and by the theorem, there exists $$a\;\in\;\mathbb{B}^N\Big(0,\frac{\varepsilon}{\max_{x\in X}\|x\|}\Big),$$ for which $f_a$ is a Morse function. Then by Cauchy-Schwartz-Bunyakowsky, $$\sup_{x\in X}|f(x)\!-\!f_a(x)|= \sup_{x\in X}|\langle x,a\rangle|\leq \sup_{x\in X}\|x\|\|a\|\leq \varepsilon.$$