  Thomson's theorem states that static charge distributions in conductors only
exist at the conducting surfaces in an equipotential configuration, yielding a
minimal electrostatic energy. In this work we present a proof for this theorem
based on the variational principle. Furthermore, an analogue statement for
magnetic systems is also introduced and proven: the stored magnetic field
energy reaches the minimum value for superficial current distributions so that
the magnetic vector potential points in the same direction as the surface
current. This is the counterpart of Thomson's theorem for the magnetic field.
The result agrees with the fact that currents in superconductors are confined
near the surface and indicates that the distinction between superconductors and
hypothetical perfect conductors is fictitious.
