  Energy gaps are crucial aspects of the electronic structure of finite and
extended systems. Whereas much is known about how to define and calculate
charge gaps in density-functional theory (DFT), and about the relation between
these gaps and derivative discontinuities of the exchange-correlation
functional, much less is know about spin gaps. In this paper we give
density-functional definitions of spin-conserving gaps, spin-flip gaps and the
spin stiffness in terms of many-body energies and in terms of single-particle
(Kohn-Sham) energies. Our definitions are as analogous as possible to those
commonly made in the charge case, but important differences between spin and
charge gaps emerge already on the single-particle level because unlike the
fundamental charge gap spin gaps involve excited-state energies. Kohn-Sham and
many-body spin gaps are predicted to differ, and the difference is related to
derivative discontinuities that are similar to, but distinct from, those
usually considered in the case of charge gaps. Both ensemble DFT and
time-dependent DFT (TDDFT) can be used to calculate these spin discontinuities
from a suitable functional. We illustrate our findings by evaluating our
definitions for the Lithium atom, for which we calculate spin gaps and spin
discontinuities by making use of near-exact Kohn-Sham eigenvalues and,
independently, from the single-pole approximation to TDDFT. The many-body
corrections to the Kohn-Sham spin gaps are found to be negative, i.e., single
particle calculations tend to overestimate spin gaps while they underestimate
charge gaps.
