A singular Riemannian geometry approach to Deep Neural Networks I. Theoretical foundations. (January 2023)