The Algebraic Characterization of Geometric 4-Manifolds