Proof of $dE = T dS − P dV + µdN$ I'm following this book. The author states The First Law of Thermodynamics as follows:

$$dE = đQ + đW + đC$$ , (3.50)
where


– đQ = energy put into the system thermally by an environment, such
as a stove;


– đW = mechanical work performed on the system by forces arising
from pressure, electromagnetism, etc.;


– đC = energy brought into the system, either by particles that arrive
as a result of environmental changes, or by the environment itself.
This includes large-scale potential energy, such as that due to gravity
when we are treating a large system such as an atmosphere.

where $dE$ is the infinitesimal increase in a system’s internal energy.
Then he goes on to replace $đQ$ with $TdS$ using the following argument:

In Section 3.8 we found that entropy is extensive: the total entropy of a
set of interacting systems is always the sum of the systems’ individual entropies, even though this total entropy grows as the systems evolve toward
equilibrium. Indeed, at constant volume and particle number (i.e., for thermal interactions only), the First Law says $dE = đQ$, whereas (3.141) says
$dE = T dS$. We infer that $T dS$ is the desired replacement for $đQ$ that makes
for an exact-differential-only quasi-static version of the First Law. Replacing the “heat into the system”, $đQ$, with $T dS$ is something that we already
saw and used in the discussion around Figure 3.13. We might replace dE
with $đQ$ in that discussion and observe that, whereas we certainly can write
$đQ_1 = T_1 dS_1$ and $đQ_2 = T_2 dS_2$
, we cannot write “$đQ = T dS$” for the entire
evolving system. So, the quasi-static version of the First Law using only exact
differentials applies individually to each subsystem, but not to the combined
system, because it is only the subsystems that are always held very close to
equilibrium.

I don't understand this because it seems like it will work only for constant volume and particle number and also it is known that $đQ = TdS$ is true only for reversible processes, so we can't infer that $dE = T dS − P dV + µdN$ holds in general.
Also, if the book's reasoning is indeed not well-founded, how to actually prove this?
Edit: I highlighted the exact place where the assumption about constant volume is made. I don't understand how we can then proceed to conclude that something is true for any quasi-static process.
 A: I think you are correct, the quoted text is not an entirely convincing and clear argument for validity of the relation $dU = TdS - PdV+\mu N$ in homogeneous simple systems, in general.
One way to make such an argument is this: any equilibrium state with defined quantities $U,S,V,N$ can be reached from the reference state by some reversible process, in which $dQ = TdS$ holds all along (which we know from Clausius), and also $dW = -pdV$ holds all along. Consequently, one can define $S$ and $U$ at any equilibrium state of the system, and then $U$ is function of $S,V,N$, and for any infinitesimal variation of $S,V,N$ in the space of thermodynamics states, we have the mathematical relation from multivariate calculus:
$$
dU = \frac{\partial U}{\partial S}_{V,N}\bigg|dS + \frac{\partial U}{\partial V}\bigg|_{S,N}dV + \frac{\partial U}{\partial N}\bigg|_{S,V}dN.
$$
This is valid for any process where $U,S,V,N$ and the corresponding derivatives are defined all along, even for those processes which are not entirely reversible.
Further physics arguments identify
$$
\frac{\partial U}{\partial S}\bigg|_{V,N} = T,
$$
$$
\frac{\partial U}{\partial V}\bigg|_{S,N} = -p,
$$
$$
\frac{\partial U}{\partial N}\bigg|_{S,V} = \mu.
$$
Thus $dQ=TdS$ can be valid even for irreversible processes, provided the variables change in such a way that they are defined all along at all stages of the process. This is when the process can be represented as a curve in the space of thermodynamic equilibrium states. For example, if heat transfer is over a non-zero temperature difference outside the system, but inside the system, temperature is uniform, then $dQ=TdS$, even though the process as a whole is irreversible.
A: Typically we have $dQ = TdS$, as provided by Clausius' inequality, and an analysis of entropy as path independent. The way I understand this is that a transfer of heat is always associated with a corresponding change in entropy, which is scaled by the temperature of the exchange.
In Enrico Fermi's very old book Thermodynamics there is a very satisfactory derivation of this differential of entropy via a thought experiment which uses a system receiving/releasing heat to a series of Carnot cycles.
But in Reichl's Introduction to Thermodynamics he does state the following:
$$TdS \geq dQ$$
Reference, equation $(2.56)$, 2nd edition.
His statement is that the equality holds for reversible processes and the inequality holds for spontaneous or irreversible processes.
He also uses the term entropy production  to account for this extra entropy:
$$dS = d_i S + \frac{dQ}{T}$$
Where $d_i S$ is zero for a reversible process.
In other words: entropy can increase for other reasons besides a direct transfer of heat. Entropy is a measure of disorder, so there are transformations which involve a bigger change in this disorder other than the heat transfer itself.
