Core formation and chemical equilibrium in the Earth—I. Physical considerations