We want to prove that for generic $\vec{a}$ the function $f_{\vec{a}}$ is an excellent Morse function, i.e., all critical points are nondegenerate, and no two of them are on the same level set of $f_{\vec{a}}$. We set

We say that a set $S\subset\bR^n$ is generic (in semialgebraic sense) if its complement is a semialgebraic set of dimension $<n$. Sard's theorem implies that for generic $\vec{a}$ the critical set $C(\vec{a})$ is discrete. Being semialgebraic this implies that it is also finite.

The set $\eZ$ is semialgebraic. We denote by $\pi:\eZ\to\bR^n$ the projection

$$\eZ\ni (\vec{x},\vec{a})\to \vec{a}\in \bR^n. $$

For any $S\subset \bR^n$ we set $\eZ(S):=\pi^{-1}(S)$. There exists a generic set $G\subset \bR^n$ such that for any connected component $A$ of $G$ the induced map $\pi:\eZ(A)\to A$ is a twice differentiable covering. Thus there exists a positive integer $m=m(A)$ and twice differentiable maps

We claim that $f_{\vec{a}}$ is excellent for generic $\vec{a}\in A$. We argue by contradiction. Suppose that this is not the case. Then there exists a nonempty, connected open subset $A_*\subset A$ and indices $i\neq j$ such that