  There are several formulations of the second law, and they may, in principle,
have different domains of validity. Here a simple mathematical theorem is
proven which serves as the most general basis for the second law, namely the
Thomson formulation (`cyclic changes cost energy'), applied to equilibrium.
This formulation of the second law is a property akin to particle conservation
(normalization of the wavefunction). It has been stricktly proven for a
canonical ensemble, and made plausible for a micro-canonical ensemble.
  As the derivation does not assume time-inversion-invariance, it is applicable
to situations where persistent current occur. This clear-cut derivation allows
to revive the ``no perpetuum mobile in equilibrium'' formulation of the second
law and to criticize some assumptions which are widespread in literature.
  The result puts recent results devoted to foundations and limitations of the
second law in proper perspective, and structurizes this relatively new field of
research.
