(commuting with the particle number operator). The density of each $\Gamma_n$ is defined by $$\begin{gathered}
\rho_{\Gamma_n}(x)=\\
n\!\!\!\sum_{\substack{\sigma_1,...,\sigma_n\\ \in\{1,...,q\}}}\int_{{\mathbb{R}}^{3(n-1)}}
\Gamma_n(x,\sigma_1,x_2,...,x_n,\sigma_n;x,\sigma_1,x_2,...,x_n,\sigma_n)dx_2\cdots dx_n \end{gathered}$$ where $\Gamma_n(x_1,...,\sigma_n;x_1',...,\sigma'_n)$ is the kernel of the trace-class operator $\Gamma_n$. This kernel is such that $$\begin{aligned}
&\Gamma_n(x_{\tau(1)},\sigma_{\tau(1)},...,x_{\tau(N)},\sigma_{\tau(N)}\;;\;x'_1,\sigma'_1,...,x'_N,\sigma'_N)\\
&\qquad=\Gamma_n(x_1,\sigma_1,...,x_N,\sigma_N\;;\;x'_{\tau(1)},\sigma'_{\tau(1)}...,x'_{\tau(N)},\sigma'_{\tau(N)})\\
&\qquad ={\varepsilon}(\tau)\;\Gamma_n(x_1,\sigma_1,...,x_N,\sigma_N\;;\;x'_1,\sigma'_1...,x'_N,\sigma'_N)\end{aligned}$$ for every permutation $\tau\in{\mathfrak{S}}^N$ with signature ${\varepsilon}(\tau)\in\{\pm1\}$.

If $\int_{{\mathbb{R}}^3}\rho=N\in\mathbb{N}$ and we restrict ourselves to mixed states $\Gamma$ where only $\Gamma_N$ is non-zero, we obtain Lieb’s functional [@Lieb-83b]. If we further assume that $\Gamma_N=|\Psi\rangle\langle\Psi|$ is a rank-one projection, then we find the original Levy or Hohenberg-Kohn functional [@HohKoh-64; @Levy-79]. It is well known [@Lieb-83b] that working with mixed states has several advantages, in particular we obtain a convex function of $\rho$.

The grand-canonical version  is less popular but still important physically.[^2] It is also a convex function of $\rho$. The fact that we can appeal to states with an arbitrary number $n$ of particles (but still a fixed average number $\int_{{\mathbb{R}}^3}\rho$) will considerably simplify several technical parts of our study. We expect that our main result (Theorem \[thm:LDA\] below) holds the same for the canonical functionals, for which the energy is minimized over mixed or pure states with $N$ particles.

It is useful to subtract the direct term from $F_{\rm 