Given a vector $y$ in a Hilbert space (possibly infinite-dimensional) and the subspace $\mathcal{T}$ spanned by a set of linearly dependent vectors $(x_1, \dots, x_p)$, I want to write the orthogonal (with respect to the inner product $\langle , \rangle$ of the Hilbert space) projection of $y$ on $\mathcal{T}$.
By generalizing the formula for linearly independent vectors (see, e.g., this question), I think it should be given by $$ \Pi ( y | \mathcal{T} ) = \sum_{ij} \langle y , x_i \rangle \left(G(x)^{-}\right)_{ij} x_j $$ where $G(x)_{ij} = \langle x_i , x_j \rangle$ is the singular Gram matrix of the vectors and $G(x)^{-}$ denotes its Moore-Penrose pseudoinverse.
Any comment or reference is greatly appreciated.