Theory of functional principal components analysis for discretely observed data