Theory of projection of spurious center of mass and rotational states from many-body nuclear wave functions