I didn't understand the derivation of why Gibbs free energy becomes negative when change is spontaneous.
Our chemistry teacher's derivation was like this.
$$dE = TdS - PdV \leq TdS - P_{ext} \cdot dV$$ (equality holds when change is reversible)
Then for constant $S$ and $V$, $dE \leq0$.
But as $dE$ always equals to $TdS - PdV$(between two any equilibrium states we can always choose a reversible process), isn't $dE$ always zero when $dS, dV = 0$?
$$dE = TdS - PdV = 0\ \text{for constant }S, V$$ $$dH = TdS + VdP = 0\ \text{for constant }S, P$$ $$dG = VdP - SdT = 0\ \text{for constant }P, T$$
He said that this equality holds when the state is in equilibrium, and when change is irreversible then $dE<0$, $dH<0$, and $dG<0$ because of Clausius inequality. But I can't understand this logic also.
Is this derivation right?
And can you explain how to derive $dG < 0$ when change is spontaneous?