Degenerate perturbation theory