$\newcommand{\SO}[1]{\text{SO}(#1)}$ $\newcommand{\dist}{\operatorname{dist}}$
Let $\mathbb{D}^n$ be the closed $n$-dimensional unit ball, and let $f:\mathbb{D}^n \to \mathbb{R}^n$ be smooth, with $\text{rank}(df) \ge n-1$ everywhere.
Set $X=\text{GL}^+_n \cup \{ A \in M_n \, | \,\,\sigma_1(A) < \sigma_2(A)\},$ whereLet $M_n$ is$\mathbb{D}^n$ be the space of realclosed $n \times n$ matrices$n$-dimensional unit ball, and $\sigma_1(A) \le \sigma_2(A) \le \dots \sigma_n(A)$ are the singular values oflet $A$$f:\mathbb{D}^n \to \mathbb{R}^n$ be smooth.
Note that $X \subseteq \{ A \in M_n \, | \, \text{rank}(A) \ge n-1 \}$, since ifSet $$X=\text{GL}^+_n \cup \{ A \in M_n \, | \text{ the singular values of } \, A \text{ are distinct }\}$$ Here $\sigma_1=0$ we must have$M_n$ is the space of real $\sigma_2>0$$n \times n$ matrices. Writing $X$ as a disjoint union, $$X=\text{GL}^+_n \cup (\text{rank}=n-1) \cup (\text{GL}^-_n \cap \{\sigma_1 < \sigma_2\}).$$
Question: Do there there exist $f_n \in C^{\infty}(\mathbb{D}^n, \mathbb{R}^n)$ such that $f_n \to f$ in $W^{1,2}(\mathbb{D}^n, \mathbb{R}^n)$ and $df_n \in X$ everywhereeverywhere on $ \text{int}(\mathbb{D}^n) $?
Does anything change if we want $W^{3,1}$ convergence of the $f_n$? (instead of $W^{1,2}$)
Edit: Perhaps it would be easier to create a perturbation where all the singular values are distinct. For a start, can Can we at least perturb $f$ to make the points inside the unit ball where the are recurring singular values isolated? This amountsWe need to understandingunderstand what happens to the zeroes of the discriminant of the characteristic polynomial of $df^Tdf$ under perturbation.
A few words on my motivation:
I am studying the functional $E:C^{\infty}(\mathbb{D}^n,\mathbb{R}^n) \to \mathbb{R}$, given by $$ E(f)= \int_{\mathbb{D}^n} \dist^2 (df,\SO{n})=\int_{\mathbb{D}^n} |df-Q(df)|^2, $$ where $Q(df)$ is a closest matrix to $df$ in $\SO{n}$.
It turns out that for a matrix $A \in M_n$, there exist a unique matrix $Q(A) \in \text{SO}_n$ which is closest to $A$ (w.r.t the Frobenius norm) if and only if $A \in X$. Furthermore, the map $A \to Q(A)$ is smooth as a map $X \to \SO{n}$.
Thus, if $df \in X$ everywhere, than $Q(df)$ is smooth. This makes differential analysis of $Q(df)$ possible, which is useful in the context of the variational problem I am facing.