Proof of the Landau–Zener formula