Diagonalization in Logic and Mathematics