Selective synthesis of pyrrolidin-2-ones and 3-iodopyrroles via the ring contraction and deformylative functionalization of piperidine derivatives.