Characterizing projective spaces