Definition of reversibility for a non-adiabatic process I would like to find a clear definition for the following expression:

System A undergoes a reversible transformation

when the transformation is not adiabatic (when system $A$ is not thermally isolated). I'm going to try to explain what I have in mind. My question is something like:

*

*do you see any limit, mistake, misunderstanding or confusion in my attempt to find a definition?

*have you found a more satisfying or relevant definition?

The definition of reversibility for "the transformation of $A$ + surroundings" is ok. This is the definition of reversible for an adiabatic process. You can do it thanks to $dS=0$, statistical equilibrium at each stage or ideas such as "you can go backwards".
When heat exchange comes into play, I sense a certain confusion. We know that heat exchange from a source $B$ of different temperature is irreversible for $A + B$. But from the point view of $A$ only, does this matter?
Here is an example:
You have a heat bath at temperature $T_{bath}$ and an ideal gas (say with $N$ particles) initially at $(V_{gas}=V,T_{gas}=T_{bath})$. Then:

*

*You expand it adiabatically (and reversibly) to $2V$.

*let heat flow from the bath into the gas until equilibrium (at constant volume)

*compress it adiabatically (and reversibly) to $V$

*let heat flow from the gas to the bath until equilibrium (at constant volume)

From Clausius's point of view, this is a reversible cycle:
$$\oint \frac{\delta Q}{T_{gas}} = 0$$
Thus, you could say the process is reversible (for $A$) even though some irreversible heat exchange happens. I'm tempted to say irreversibility (for $A$) cannot be about heat exchange with the environment. As long as the work is reversible ($\delta W = -PdV$), the process can be called reversible. For a reversible process, you have $\delta Q = TdS$ but this is not a property of the heat exchange, only a consequence of the fact the entropy is increased by the heat only (no extra growth by some irreversible work).
Thus, reversibility would be about work only. A transformation could be said to be reversible if the work done on the system is reversible:

System A undergoes a reversible transformation if the work done on the system is predicted by the generalized reversible force: $\delta W = -PdV$ with $P=-\left(\frac{dU}{dV}\right)_S$. This is equivalent to $\delta Q = TdS$.

Does this work?
 A: You incorrectly applied the Clausius inequality to the gas, and the process you described definitely involves an increase in entropy of the reservoir.
The amount of heat transferred from the reservoir to the gas in step 2 is less than the amount of heat transferred from the gas to the reservoir in step 4.  So, there is a net transfer of heat from the gas to the reservoir over the cycle you described.  And, over the cycle, for the gas $$\Delta S=0>\int{\frac{\delta Q}{T}}$$ (in agreement with the Clausius inequality for an irreversible process), and, for the combination of gas plus reservoir $$\Delta S>0$$
A: 
System A undergoes a reversible transformation
when the transformation is not adiabatic (when system  is not
thermally isolated).

If you are thinking a transformation must be adiabatic to be reversible, that is not correct. As long as any heat transfer in the transformation is performed reversibly, that transformation is then reversible. In order for heat transfer to be considered reversible, the transfer must occur over an infinitesimal temperature difference, i.e., the temperature difference must be essentially zero. Since heat is defined as energy transfer due solely to temperature difference, any real heat transfer process is irreversible. The reversible heat transfer transformation is an idealization.

Thus, reversibility would be about work only. A transformation could
be said to be reversible if the work done on the system is reversible:

It is not about work only, if the heat transfer is reversible. Even in the case of an adiabatic expansion transformation the assumption is that any pressure difference between the system and surroundings is infinitesimal, or essentially zero. But in any real transformation in order for the system to do work there must be a net force (pressure difference) acting through a distance. So the reversible adiabatic expansion is also an idealization.
In summary, all real processes occur as a consequence of some type of disequilibrium (temperature disequilibrium, pressure disequilibrium, chemical disequilibrium, etc.). All real processes are irreversible.
Hope this helps.
A: The problem with trying to define a notion of a reversible process for a system independent of its environment is that all processes can be reversed by some process in some environment, its just that reversing some processes require a much more extreme environment to go in one direction than the other. If I break a metal bar in 2 I will have done irreversible work on it, but I can still get the original metal bar back by melting it down and recasting it.
In terms of actual formalism, thermodynamics deals with systems in thermodynamic equilibrium; these systems don't do anything unless their environment changes in some way. Trying to separate the process from the environment that causes it, therefore, is not terribly meaningful.
