Every $n \times n$ real matrix $A$ has a polar decomposition $A=OP$, where $O \in O\_n, P$ is symmetric positive semi-definite.


$P$ is uniquely determined by $A$, by $P(A)=\sqrt{A^TA}$,
and when $A$ is invertible $O$ is also unique, given by $O=A(\sqrt{A^TA})^{-1}$.


When $A$ is not invertible, then $O$ is non-unique.


**Question:**


Can we choose a **smooth** polar factor $O(A)$ for all **non-zero** matrices $A$ with non-negative determinant? 


More precisely, denote by $M\_n^+$ the set of matrices with non-negative determinant. 


Is there a smooth function $O:M\_n^+ \setminus \{0\} \to O\_n $ such that for every $A \in M\_n^+ \setminus \{0\}$, $A=O(A)P(A)=O(A)\sqrt{A^TA}$?


**Remarks:**


1) We know that such a function, if exists, must give to each $A \in GL\_n^+$ its unique polar factor. 


2) The reason we exluded the zero matrix is that continuity implies two contradictory evaluations:


$O(0)=\lim\_{t \to 0^+} O(\left(\begin{matrix}t & 0 \\ 0 & t\end{matrix}\right))=I$, 


$O(0)=\lim\_{t \to 0^+}=O(\left(\begin{matrix}0 & -t \\ t & 0\end{matrix}\right))=\left(\begin{matrix}0 & -1 \\ 1 & 0\end{matrix}\right)$


3) The reason we had to restrict to $M\_n^+ \setminus \{0\}$ (instead of working with all $M\_n \setminus \{0\}$) is connectedness issues. 


$M\_n\setminus \{0\}$ is connected (for $n >1$). However for $O|\_{O\_n}=Id\_{O\_n}$, so if we insisted to take the domain to be all $M\_n \setminus \{0\}$, the image would be $O\_n$ which is disconnected.


The restriction in fact implies that $O$ is a function into $SO\_n$.



Is there a smooth polar decomposition for non-invertible matrices?
To take [user35593's comment](https://mathoverflow.net/questions/238019/is-there-a-smooth-polar-decomposition-for-non-invertible-matrices#comment588899_238019) to fruition:



> 
> There is a unique continuous extension of the polar decomposition from $GL^+\_n$ to the portion of its boundary consisting of matrices with nullity 1. 
> 
> 
> 


### Why is the polar decomposition non-unique when $A$ is non-invertible?


Suppose $A = OP$ and $P$ has non-trivial kernel. Then if $\Omega$ is any orthogonal matrix that acts as the identity on $\mathrm{ker}(P)^\perp$, then $O\Omega P$ is another polar decomposition. And it is easy to see that this freedom is the extent of non-uniqueness: if $A = OP = \tilde{O} P$, then $O^{-1} \tilde{O}$ is an orthogonal matrix that acts as the identity on $\mathrm{ker}(P)^\perp$. 


When the kernel of $A$ (equivalently kernel of $P$) is one dimensional, then the only possibility for $\Omega$ is the matrix that is the identity on $\mathrm{ker}(P)^\perp$ and $-1$ on $\mathrm{ker}(P)$. 


### Proof of claim


Now, since $\det A = \det O \det P$ and we know that $\det P \geq 0$, when we restrict to $GL\_n^+$ we must have that $\det O > 0$. That is, on $M\_n^+$ we can require the matrix $O$ in the polar decomposition to be not only orthogonal, but in fact in $SO\_n$. And for rank $n-1$ matrices only one of $O$ and $O\Omega$ can fulfill that criterion. And it is easy to check that this is the continuous extension from $GL\_n^+$. 


*Remark*: if you extend from $GL\_n^-$ you will pick up the other one. An illustrative example is the rank $1-1 = 0$ matrix $(0)\in M\_1$. Approaching from $M\_1^+$ the continuous limit of the polar decomposition gives $$ (0) = (1)(0)$$
while approaching from $M\_1^-$ the continuous limit of the polar decomposition gives 
$$ (0) = (-1)(0). $$


### Differential geometry


To answer [this question in the comments](https://mathoverflow.net/questions/238019/is-there-a-smooth-polar-decomposition-for-non-invertible-matrices#comment588914_238019): no, when $n > 1$ the set $M\_n^+$ is should not be thought of as a (smooth) submanifold with boundary; it is better described as a manifold with corners. This is precisely what you outlined in your post with the different limiting directions approaching the zero matrix. 


But in a neighborhood of (topological) boundary points which have rank $n-1$, the set $M\_n^+$ does look like a manifold with boundary: in a neighborhood of a rank $n-1$ matrix, the function $\det: M\_n\to \mathbb{R}$ has non-vanishing derivative, and so can be used as a defining function for a hypersurface. 


