Rank and symmetry of Riemannian manifolds