I don't have much background on high-dimensional geometry, so I dare to ask it.

For a given point in $x\in\mathbb{R}^n$, assume that I want to find the point on the unit sphere that is closest to the point $x$. It's easy -- this can be computed by constructing a line through $x$ and the origin, and find the point where this line intersects with the sphere. I'd like to generalize this to $\mathbf{X}\in\mathbb{R}^{n\times k}$ where the sphere is replaced with a Stiefel manifold $\mathbf{Z}^T\mathbf{Z}=\mathbf{I}_{k\times k}$.

Originally the columns of $\mathbf{X}$ constitute the orthonormal basis of $k$-dimensional subspace of $\mathbb{R}^n$, which means $\mathbf{X}$ is on the Stiefel manifold. But the matrix is perturbed by some random matrix $\mathbf{E}$ such that $\tilde{\mathbf{X}}=\mathbf{X}+\mathbf{E}$. I want to find the *closest* point of $\tilde{\mathbf{X}}$ that is on the Stiefel manifold. In this case, the *distance* between two matrices $\mathbf{X}$ and $\mathbf{Y}$ must be measured by comparing their orthonormal projectors $||\mathbf{X}\mathbf{X}^T - \mathbf{Y}\mathbf{Y}^T||_2$ to avoid technical issues with ordering and rotations among the basis vectors.

I think there exists only one point $\mathbf{Y}$ on the Stiefel manifold that is closest to $\tilde{\mathbf{X}}$, but I'm not sure how to find it. One thing I can try is employing Lagrange multipler and try to minimize $||\tilde{\mathbf{X}}\tilde{\mathbf{X}}^T - \mathbf{Y}\mathbf{Y}^T||_2$ subject to $\mathbf{Y}^T\mathbf{Y}=\mathbf{I}$, but I'm not sure whether I have to compute derivative of a spectral norm of a matrix. Is there any 'natural' computation to find it?