Curvature and homology