Let's say we have a system where the number of states at an energy $U$ is given by the function $N(U)$, so that the entropy $S(U)$ is given by $S(U)=\log N(U)$.

Now suppose this system is put in contact with a large thermal resevoir at temperature $T$. What energy will our system likely have after this contact has been made?

To answer this question we must ask how many states there are where our system has an energy $U$. We know the total number of states for our system is $e^S$, but what is the total number of states for the resevoir? The total number of states for the resevoir is similarly $e^{S_R(U_{\textrm{Total}} - U)}$, where $S_R(U_{\textrm{Total}}-U)$ is the entropy of the resevoir when it has energy $U_{\textrm{Total}}-U$ and $U_{\textrm{Total}}$ is the total energy of the bath plus resevoir system.

Since the state of the resevoir and the state of our system can be chosen independently, the total number of states for the combined system is the product of the number of states for the individual system. Thus the total number of states for the combined system is $e^S e^{S_R(U_{\textrm{Total}} - U)} =e^{S(U)+ S_R(U_{\textrm{Total}} - U)}$. If we expand the entropy of the resevoir we find
\begin{equation}
\begin{aligned}
S_R(U_{\textrm{Total}} - U) &\approx S_R(U_{\textrm{Total}}) - U * \partial_U S \\
&= S_R(U_{\textrm{Total}}) - U /T \\
\end{aligned}
\end{equation}
so that the total number of states is proportional to $e^S e^{- U/T} =e^ {S- U/T} = e^{(TS-U)/T} = e^{-F/T} $.

The system will almost certainly have the most probably energy. The most probably energy is the one that corresponds to the most states. Therefore it is the one that maximizes $e^{-F/T}$. Therefore it must be the one that minimizes $F$.

I quote from the abstract of one of the articles which the OP linked in the question preceding this one

The principle of increase of entropy is used to obtain the condition for mechanical equilibrium in an isolated system divided into two parts by a frictionless, weightless piston which is made of a perfectly thermally insulating material. The result emphasizes that the principle can be used to obtain the condition for mechanical equilibrium without the **assumption**, frequently made in the textbooks, **that the mechanical equilibrium is accompanied by thermal equilibrium**.

It seems to be explicitly stated here that Callen's "flaw" is this assumption. See also this physics.SE question for an explanation of the difference between mechanical and thermal equilibrium in one of the answers.

To summarise in my own words: $P_1 = P_2$ only makes sure that you are in a state where nothing is moving/accelerating (i.e. that you are in mechanical equilibrium), which would obviously be the case if $P_1 \neq P_2$ (thus it is a necessary condition, as the OP states). However this is not sufficient to conclude that you are in thermodynamic equilibrium, because due to thermal fluctuations you always get $P_1 \neq P_2$ *some of the time*. Now it could be the case that the $(P_1 = P_2)$-state was **metastable** and drifts away from the mechanical equilibrium induced by the small fluctuations. As far as I can tell from the articles linked in the other question that is not the case, so $P_1 = P_2$ does turn out to be the correct condition, but Callen did not rigorously show that the "restoring force" accompanying the fluctuations leads back to the mechanical equilibrium.

I am not 100% sure if this answers the question, nor if it is correct. In particular I personally think that Callen's argument can easily be made complete by noting that the mechanical equilibrium $P_1 = P_2$ is **unique**. I mean if your system leaves mechanical equilibrium due to fluctuations it has to go somewhere. And there is no second mechanical equilibrium for it to go to. I.e. necessary $\Leftrightarrow$ sufficient since it is also unique.

**Update**

This is to address the update to the question (v6).

Additionally to the original question the update contains an outline of the argument that is supposed to be correct, yielding the same outcome as Callen's argument. The OP then points out that the arguments seem to be the same.

I don't think this is the case. As stated previously by the OP Callen only uses the first law while for a correct proof of the equilibrium the second law should be employed. The reason for this is what I tried to point out above in my original answer. The first law is a mere statement of energy conservation. You can't extract information about thermodynamic equilibrium by simply imposing the constraints of your system. That only shows that mechanical equilibrium is realised, which is a necessary but not sufficient condition for thermodynamic equilibrium (as the OP already stated repeatedly).

The second law provides the sufficiency. Why? Because it is a statement about the nature of thermodynamic equilibrium itself, in particular it tells you how fluctuations behave around the point of equilibrium and that you will bounce back into your original state under fluctuation perturbations, to say it from the statistical mechanics viewpoint.

One of the OPs doubts is

Indeed, from (4) and (9) we would obtain $dU_2 = -P_2 dV_2$ (analogos to (1)): this, together with (1), (2) and (10), would give us Callen's argument again!

Of course your are going to get the same relations as from the first law if you plug the relations obtained from the second law argument into each other, because mechanical equilibrium happens to be thermal equilibrium in the situation considered. However I fail to see how this coincidence means that they are the same argument, since they start from completely different points.

## Best Answer

In thermodynamics, any well-behaved quantity of matter generally has a temperature (a measure of average internal energy) associated with it. Therefore, the sole addition or removal of matter from a volume is not accompanied by a change in the energy contained in that volume if and only if the matter transferred has zero temperature; transferring matter at nonzero temperatures is the same as transferring energy. In all reasonable cases then, this is an impossibility.

One might argue that one simply has to remove the corresponding amount of heat as matter of some nonzero temperature is added, or vice versa, but this requires walls that

doallow energy transfer.