I've just learnt in this Unique factorisation of prime geodesics? question that there is an analogy between prime geodesics and prime ideals in number fields. You can read more about it here: https://ncatlab.org/nlab/show/prime+geodesic or just open the paper that @Meow mentions(https://www.math.upenn.edu/~ted/620F09/References/Sunada/0.pdf). Moreover, this analogy deeply relies on the analogy between extensions of number fields and Riemannian coverings and you can learn a striking result of the paper that says that zeta functions of number fields are related to zeta functions constructed by the use of eigenvalues of Laplace operator. Of course, one can suspect that this is all not accidental. My question is: is there any functor from Riemannian manifolds to number fields and a functor from (I don't know which category) to $Aff$(affine schemes) which sends a space of prime geodesics on a Riemannian manifold up to metricpreserving homotopy to the spectrum of a ring of integers in a field which explains this analogy?

7$\begingroup$ I'm unconvinced that a functor is the right thing to look for. Many analogies in mathematics are either linked by a larger generality that encompasses both (e.g. Galois groups and fundamental groups, linked many decades later by the étale fundamental group), or remain analogies forever (e.g. between proper curves over finite fields and number fields with their archimedean and nonarchimedean places). I think it would be much more fruitful to look for a 'generalised geometric theory' that allows both as a special case. $\endgroup$ – R. van Dobben de Bruyn Sep 10 '18 at 5:42