  In this paper we elaborate on the interplay between energy optimization,
positive definiteness, and discrepancy. In particular, assuming the existence
of a $K$-invariant measure $\mu$ with full support, we show that conditional
positive definiteness of a kernel $K$ is equivalent to a long list of other
properties: including, among others, convexity of the energy functional,
inequalities for mixed energies, and the fact that $\mu$ minimizes the energy
integral in various senses. In addition, we prove a very general form of the
Stolarsky Invariance Principle on compact spaces, which connects energy
minimization and discrepancy and extends several previously known versions.
