Spectral theory for Fredholm operators