Semialgebraic Morse-Sard Theorem - why are the critical points of a semi-algebraic map again semi-algebraic?

2.5.12 Exercise (Semi-algebraic Morse-Sard theorem)

Let $f:M\to N$ be a $C^\infty$ semi-algebraic map between semi-algebraic submanifolds of $\Bbb R^n$ and $\Bbb R^m$, respectively. Set $$C = \{x\in M; \operatorname{rank} df_x < \dim N\},$$ $$S=\{y\in N; y=f(x), x\in C\}.$$ Then $S$ is a semi-algebraic set and $\dim S<\dim N$.

I was reading this theorem from Benedetti and Risler book, and I cannot understand why is $C$ a semialgebraic set. Is the rank of a linear transformation a semialgebraic map? I can't see why.


The condition that a matrix is of rank $<n$ is that the determinants of all $n\times n$ minors vanish. Since the determinant is a polynomial in the entries of the matrix, this is a collection of polynomial conditions on the entries of the matrix.

As the matrix $df$ has semi-algebraic entries because the derivative of a semi-algebraic function is semi-algebraic (where it exists), the determinant of any minor of $df$ is again semi-algebraic, being a polynomial in semi-algebraic functions. Therefore the condition that $\operatorname{rank} df_x < \dim N$ is semi-algebraic.