Ionization potential of extended systems: Validity of Koopmans’ theorem in the Hartree-Fock theory and invalidity of the IP-theorem in density functional theory