A quantum system Σ(n) with variables in Z(n), where n = Q pi (with pi prime numbers), is considered. The non-near-linear geometry G(n) of the phase space Z(n) × Z(n), is studied. The lines through the origin are factorized in terms of 'prime factor lines' in Z(pi)×Z(pi). Weak mutually unbiased bases (WMUB) which are products of the mutually unbiased bases in the 'prime factor Hilbert spaces' H(pi), are also considered. The factorization of both lines and WMUB is analogous to the factorization of integers in terms of prime numbers. The duality between lines and WMUB is discussed. It is shown that there is a partial order in the set of subgeometries of G(n), isomorphic to the partial order in the set of subsystems of Σ(n).