Degenerate KAM theory for partial differential equations