Why is this proof of the Clausius inequality not invalid? I am reading Concepts in Thermal Physics (2nd ed) by S. J. Blundell and K. M. Blundell. In section 16.5 (Thermodynamic potentials - Constraints) there is an explanation of the role of the Helmholtz free energy in an isothermic process. The end result is that $đW \geq dF$ (the work done on the system is greater than the increase in the Helmholtz function).
The derivation begins (paraphrased): Consider a system in contact with a reservoir at temperature $T$. If heat $đQ$ enters the system then the entropy change of the surroundings is $dS_0 = -đQ/T$ and the entropy change $dS$ of the system has to be such that $0 \leq dS_\mathrm{universe} = dS + dS_0$, which gives $dS \geq đQ/T$, which is a statement of the Clausius inequality. The derivation goes on for a few steps, but my problem is with the beginning:
If the process is irreversible ($dS_\mathrm{universe} > 0$), how can it be that $dS_0 = -đQ/T$? The first law is $dU = đQ + đW = TdS - pdV$, but the book makes it very clear that $đQ = TdS$ and $đW = -pdV$ only for reversible processes (for irreversible processes $đQ < TdS$ and $đW > -pdV$). Is there some hidden assumption made, or am I confused about something elementary? (the latter seems far more probable...)
 A: By definition of $T$ and $S$, if a system has temperature $T$ and the heat flow into it is $dQ$, its entropy change is always $dS=dQ/T$. And considering the system alone, it is always "reversible". For example, you put it in contact with a reservoir with a higher temperature and let heat flow into it. Later you can put it in contact with a reservoir with lower temperature and let heat flow away from it. Of course if you consider the whole universes the processes are irreversible. For the process to be reversible, you need to put it in contact with a reservoir at the same temperature $T$.
I think you have misinterpreted the meaning of $T$ when the author says $dQ<TdS$. For a system of which the temperature may not even be well defined, if you put it in contact with a reservoir with temperature $T$, and the heat flowing into the system is $dQ$, then we know that
$$dS_{system}+dS_{reservoir} > 0$$
for irreversible process.
Then
$$dS_{system} > -dS_{reservoir} = -(-dQ)/T=dQ/T$$
$$dQ< T dS$$
Here $T$ is the temperature of the environment (not the system), and $dS$ is the entropy change of the system.
