  This is the first installment of a paper in three parts, where we use
noncommutative geometry to study the space of commensurability classes of
Q-lattices and we show that the arithmetic properties of KMS states in the
corresponding quantum statistical mechanical system, the theory of modular
Hecke algebras, and the spectral realization of zeros of L-functions are part
of a unique general picture. In this first chapter we give a complete
description of the multiple phase transitions and arithmetic spontaneous
symmetry breaking in dimension two. The system at zero temperature settles onto
a classical Shimura variety, which parameterizes the pure phases of the system.
The noncommutative space has an arithmetic structure provided by a rational
subalgebra closely related to the modular Hecke algebra. The action of the
symmetry group involves the formalism of superselection sectors and the full
noncommutative system at positive temperature. It acts on values of the ground
states at the rational elements via the Galois group of the modular field.
