# Minimum energy - Maximum entropy equivalence

I'm going through Callen's Thermodynamics book. After demonstrating from a physical point of view the maximum entropy implies minimum energy, the inverse argument is left as an exercise:

Show that if the entropy were not maximum at constant energy then the energy could not be minimum at constant entropy.

Hint: First show that the permissible increase in entropy in the system can be exploited to extract heat from a reversible heat source (initially at the same temperature) and to deposit it in a reversible work source. The reversible heat source is thereby cooled. Continue the argument.

The minimum energy principle states that for a given entropy, the system will reach equilibrium at minimum energy. Now if we look at the whole system, including the heat and work sources, transferring heat from a reversible source will neither change the energy of the system, nor the entropy (since $ds=\frac{dQ}{dT}$, and $T_1=T_2$). Storing the energy in the work will yet cause no change in the total energy, and since it's reversible neither in the entropy as well. The heat source will be cooled by $\frac{dQ}{C}$. Yet, I can't see where is it taking us.

I think I figured it out. We attach to our system this reversible heat source and consider it as a unit. Transferring $dQ$ indeed cause no change of entropy nor total energy in the system. We than takes this energy out of the system by storing it in a reversible work source. Since it's reversible, this cause no change of entropy as well. However, we bottomed up with losing energy from the system, staying with the same entropy and being at equilibrium, contrary to our assumption that the equilibrium is reached for minimum energy given an entropy. Thus, our original system was originally at maximum entropy, thus couldn't extract heat from the heat source.