  We propose a first-principles scheme for the description of the
magneto-optical kerr effect within density functional theory (DFT). Though the
computation of Kerr parameters is often done within DFT, starting from the
conductivity or the dielectric tensor, there is no formal justification to this
choice.
  As a first steps, using as reference materials iron, cobalt and nickel we
show that pseudo-potential based calculations give accurate predictions. Then
we derive a formal expression for the full dielectric tensor in terms of the
density-density correlation function. The derived equation is exact in systems
with an electronic gap, with the possible exception of Chern insulators, and
whenever the time reversal symmetry holds and can be used as a starting point
for the inclusion of local fields and excitonic effects within time-dependent
DFT for such systems.
  In case of metals instead we show that, starting from the density-density
correlation function, the term which describes the anomalous Hall effect is
neglected giving a wrong conductivity.
