I read this quote in some lectures about PCA:
" Also, since n points in a p-dimensional space defines a linear subspace whose dimension is at most n−1, we would find that p−n+ 1 eigenvalues are zero."*
For context, this is about the eigendecomposition of the sample covariance matrix $S = \frac{X^T X}{n-1}$ where $X$ is an n x p matrix with n less than p. The quote seems to say that p - n + 1 of its eigenvalues will be zero, but I thought that p - n of its eigenvalues would be zero (because the number of non-zero eigenvalues of S is equal to the rank of S, which is less than or equal to n?
I am confused because I thought that n points in a p-dimensional space define a linear subspace whose dimension is at most n.
Can anybody point out the mistake?
*This quote is from page 40 of https://courses.maths.ox.ac.uk/node/view_material/37962