TITLE: How far is a set of vectors from being orthogonal?
QUESTION [14 upvotes]: Given some vectors, how many dimensions do you need to add (to their span) before you can find some mutually orthogonal vectors that project down to the original ones?
Or, more formally...
Suppose $v_1,v_2,\ldots,v_k \in \mathbb C^m$.  Take $n \ge m$ as small as possible such that if we consider $\mathbb C^m$ as a subspace of $\mathbb C^n$ in the natural way, then there is a projection $\pi$ of $\mathbb C^n$ onto $\mathbb C^m$ such that for some mutually orthogonal vectors $\hat v_1,\hat v_2,\ldots,\hat v_k \in \mathbb C^n$, $\pi(\hat v_i) = v_i$ for each $i$.
Intuitively, this $n$ provides a measure of how "far from orthogonal" the original vectors are.  My  (deliberately open-ended) question is the following.  Does anyone recognize this $n$, or does the idea seem familiar to anyone from any other context?  I can't identify it with or connect it to anything else I've encountered, but I'm wondering if it might appear in some other guise in linear algebra, or elsewhere.

REPLY [2 votes]: As mohanravi points out, we can see this entirely in terms of the matrix $X^{T}X$. In particular, we are asked to find a positive semidefinite matrix of minimal rank $R$ such that $R+X^TX$ is diagonal.
We can subsume Nik Weaver's answer as follows: Let $\lambda$ be the highest eigenvalue of $X^TX$, then $R=\lambda I - X^T X$ is positive semidefinite and has rank no more than $k-1$.
This measurement has some strange properties. For instance, the matrix that is $1$ on the diagonal and $\epsilon$ off the diagonal is much harder to make diagonal by adding a positive semidefinite matrix than the matrix is that is $1$ on the diagonal and $-\epsilon$ off the diagonal, where adding a rank-$1$ matrix does the trick.