From superpositions to KAM theory