Theoretical proof of Clausius inequality (Fermi) I found a similar question but I could not solve my doubt. So, if you consider this question to be a double, I am sorry.
Consider a system $S$ that undergoes a cyclic transformation and the $n$ sources from which it receives heat have temperatures $T_1, T_2... T_n$. Let $Q_i$ be the heat received/given by the $i$-th source. After deriving Clausius inequality for all cycles:
\begin{equation}\tag{1}\sum\limits_{i=1}^n\frac{Q_i}{T_i}\leqslant0
\end{equation}
I've seen some books (Fermi, Thermodynamics is an example) doing what follows:
If the cycle is reversible, we can consider the inverse cycle, and the only difference will be the opposite sign of the heats. So:
\begin{equation}\tag{2}\sum\limits_{i=1}^n\frac{-Q_i}{T_i}\leqslant0\iff\sum\limits_{i=1}^n\frac{Q_i}{T_i}\geqslant0\end{equation}
In order to have both this inequality and the $(1)$ satisfied, for a reversible cycle we must have:
\begin{equation}\tag{3}\sum\limits_{i=1}^n\frac{Q_i}{T_i}=0
\end{equation}
Okay, there it is. From the equation $(3)$ we can conclude that for reversible cycles equality signs holds.
But Fermi also concluded that the equality holds only in that case. We have proved that the equation $(3)$ is true in the case of a reversible cycle, but we haven't proved that the equality cannot hold in any other case, so how do we conclude that
\begin{equation}
\sum\limits_{i=1}^n\frac{Q_i}{T_i}<0
\end{equation}
for non-reversible cycle?
Am I missing something or does that book take it somehow for granted? Please, note I am asking for a theoretical and mathematical explanation of this conclusion. Thanks in advance.
 A: In an irreversible process, entropy is generated within the system, so the total entropy change in each step is the sum of the entropy exchange with the surroundings at $T_i$ plus the (positive) entropy generated $\sigma_i$:
$$\Delta S_i=\frac{Q_i}{T_i}+\sigma_i$$.  So, if we add up the entropy changes for the entire cycle, we obtain:
$$\Delta S=\sum{\Delta S_i}=0=\sum{\frac{Q_i}{T_i}}+\sum{\sigma_i}$$ But, $\sum{\sigma_i}\gt0$.  Therefore,$$\sum{\frac{Q_i}{T_i}}\lt0$$
A: You are absolutely right. Fermi proves in his book only the case of reversible $\rightarrow$ equality but he nevertheless states that the equality holds only for reversible cycles. This leads to the confusion. Since entropy is defined in Fermi's book on the basis of Clausius's inequality, any explanation using entropy suffers circularity. So an honest person like you is urged to look for the proof　of equality $\rightarrow$ reversible.
I think that the dissension observed here is caused by the ambiguity of the statement of the second law. I recommend you to recall the well-known fact that the second law is nothing more than a rule of thumb. No matter how great are the physicists who described it, the ambiguity is not avoided. In other words, there is a room for the interpretation. So you are obliged to treat the statement of the second law like a clause of Constitution.
Let $Q$ be the total (net) heat absorbed by the system from a single heat source during its cyclic transformation. According to the first law, $Q=W$ , where $W$ is the total (net) work done by the system.
The second law bans $Q>0$. This corresponds to a clause of Constitution. Fermi interpreted it as $Q\leq 0$. It's OK but I think that this interpretation needs an additional constrain:
The second law allows $Q=0$ only for the special, idealistic, conceptual case of reversible cycles.
Then Fermi's explanation is perfectly in harmony with the spirit of the second law.
