My geometric intuition breaks down horribly regarding advanced concepts in thermodynamics, such as the use of thermodynamic potentials. My question here is therefore about the latter concepts (in particular, re: defining the chemical potential for an ideal gas)
$$$$
What I understand
What allows me to understand the first part of a standard thermodynamics syllabus is the understanding that (quasi-static/reversible) thermodynamics takes place on a manifold $\mathcal M$ of equilibrium states. For the ideal gas, this manifold has global coordinates $(S,P):\mathcal M\hookrightarrow \mathbb{R}^2$, and the energy function has de Rham differential $$dE = TdS-PdV,$$ Quasistatic dynamics on this manifold of equilibrium states reduces to specifying 1-dimensional curves $\gamma:I\hookrightarrow\mathcal M$ on this manifold, which, in my thermodynamics course, is usually specified equivalently as a set of $\dim \mathcal M-1$ constraints.
In case of the ideal gas, $\dim \mathcal M-1=1$, and so it suffices to specify the level set of an auxiliary function $g\in C^\infty(\mathcal M)$, and then $\gamma$ is completely specified, up to irrelevant reparametrizations. For example, the specific heat is defined via $$\frac{\partial U}{\partial T}\bigg|_g:=\frac{(U\circ \gamma)'(0)}{(T\circ \gamma)'(0)}$$ where $\gamma$ is defined by the constraint of mapping into a level set of $g$.
$$$$
What I don't understand
What I don't understand is the setting in which we wish to define dynamics that involves changes of particle number $N$, leading to the definition of the chemical potential. In this setting, the picture I defined earlier for the ideal gas falls apart catastrophically.
In this setting, my course instructor writes down that the energy function then has de Rham differential $$dE = TdS-PdV+\mu dN.\tag{1}$$ In addition, all thermodynamic partial derivatives now have two functions, $g_1,g_2\in C^\infty(\mathcal M)$, specified as constant (Kardar's MIT notes also do this : link).
All of this evidence points to the manifold of equilibrium states being implicitly extended to include a particle-number direction, i.e. defining a 3-fold $\widetilde{\mathcal M}$ with global coordinates $(S,P,N):\widetilde{\mathcal M}\hookrightarrow \mathbb{R}^3$. This would then lead to the extended de Rham differential (1) that my instructor wrote down, and would also explain why all partial derivatives now have two functions specified as constant, as $$\dim\widetilde{\mathcal M} -1 =3-1 =2.$$
Of course, now I have derived enough consequences for a dead-end, because now I will apply the equation of state for the ideal gas, which states that $N$ cannot be independent of $P,V$, because $T$ is completely determined by $P,V$ (as it usually is in e.g. a discussion of Carnot engines): $$PV = NkT$$ and thus we cannot extend $\mathcal M\to \widetilde{\mathcal M}$ the manifold of states in this manner. In particular, Kardar's partial derivatives have too many constraints, as $\widetilde{\mathcal M}$ collapses to a 2-fold, and any path $\gamma:I\hookrightarrow \widetilde{\mathcal M}$ which keeps two independent functions $g_1,g_2$ constant must be a trivial path, i.e. a point.
For example, we can write
$$E=\frac{3}{2}NkT,$$ and so $\mu = \frac{3}{2}kT$, which contradicts the standard result on Wikipedia.