  A formalisation of G\"odel's incompleteness theorems using the Isabelle proof
assistant is described. This is apparently the first mechanical verification of
the second incompleteness theorem. The work closely follows {\'S}wierczkowski
(2003), who gave a detailed proof using hereditarily finite set theory. The
adoption of this theory is generally beneficial, but it poses certain technical
issues that do not arise for Peano arithmetic. The formalisation itself should
be useful to logicians, particularly concerning the second incompleteness
theorem, where existing proofs are lacking in detail.
