  Rigorous mathematical foundations of density functional theory are revisited,
with some use of infinitesimal (nonstandard) methods. A thorough treatment is
given of basic properties of internal energy and ground-state energy
functionals along with several improvements and clarifications of known
results.A simple metrizable topology is constructed on the space of densities
using a hierarchy of spatial partitions. This topology is very weak, but
supplemented by control of internal energy, it is, in a rough sense,
essentially as strong as $L^1$. Consequently, the internal energy functional
$F$ is lower semicontinuous with respect to it. With separation of positive and
negative parts of external potentials, very badly behaved, even infinite,
positive parts can be handled. Confining potentials are thereby incorporated
directly into the density functional framework.
