You're thinking of Gödel numbering which is an elegant technique used extensively throughout that proof. He uses it to map logical symbols, statements and entire proofs to natural numbers and then proceeds to prove things about those statements and proofs by referring to them via their Gödel numbers.