This example is taken from the wikipedia page describing irreversible processes. I just want to make sure I understand correctly why the initial state can't be reached anymore. I assume the transitions to be quasi-static, but there is friction between the piston and the cylinder. If so, during the transition from state 1 to state 2, when the piston rises, some of the work is transformed into heat, which increases the internal energy of the gas. During the compression, again, some of the work is turned into heat, so the pressure from state 1 is now achieved at a higher volume (because some work was converted into internal energy). So the entropy of the system (or universe) has increased. Is this correct?