Theoretical Foundations for Digital Libraries