After recalling the standard KAM theorem in finite dimensions, I will state and give an idea of the proof of a KAM theorem for PDEs, applying in particular to ill- posed PDEs like the Boussinesq equation. The theorem relies on some geometric cancellations, a crucial feature in KAM even if in infinite dimensions one lacks the usual symplectic geometry associated to Hamiltonian systems.