term is the energy of the *Uniform Electron Gas (UEG)* [@DreGro-90; @ParYan-94; @GiuVig-05; @LewLieSei-18], containing all of the kinetic energy and the exchange-correlation energy in our convention. That is, $e_{\rm UEG}(\rho_0)$ is the ground state energy per unit volume of the infinite electron gas with the prescribed constant density $\rho_0$ over the whole space (from which the direct term has been dropped). The rationale for the approximation  is to assume that the density is almost constant locally (in little boxes of volume $dx$), and to replace the local energy per unit volume by that of the infinite gas at that density $\rho(x)$.[^1]

Our goal in this paper is to justify the approximation  in the appropriate regime where $\rho$ is flat in sufficiently large regions of ${\mathbb{R}}^3$. We will prove the following quantitative estimate $$\begin{gathered}
 \left|F_{\rm LL}(\rho)- \frac{1}{2}\int_{{\mathbb{R}}^3}\int_{{\mathbb{R}}^3}\frac{\rho(x)\rho(y)}{|x-y|}\,dx\,dy-\int_{{\mathbb{R}}^3}e_{\rm UEG}\big(\rho(x)\big)\,dx\right|\\
 {\leqslant}{\varepsilon}\int_{{\mathbb{R}}^3}\big(\rho(x)+\rho(x)^2\big)\,dx
 +\frac{C(1+{\varepsilon})}{{\varepsilon}}\int_{{\mathbb{R}}^3}|\nabla\sqrt\rho(x)|^2\,dx\\+\frac{C}{{\varepsilon}^{4p-1}}\int_{{\mathbb{R}}^3}|\nabla\rho^\theta(x)|^p\,dx
 \label{eq:LDA_main_estim_intro}\end{gathered}$$ for all ${\varepsilon}>0$, where $F_{\rm LL}(\rho)$ is the grand canonical version of the Levy-Lieb functional. The parameters $p>3$ and $0<\theta<1$ should satisfy some conditions which will be explained below. For instance, $p=4$ and $\theta=1/2$ is allowed. After optimizing over ${\varepsilon}$, this justifies the LDA when the two gradient terms are much smaller than the local term $$\begin{cases}
{\displaystyle}\int_{{\mathbb{R}}^3}|\nabla\sqrt\rho(x)|^2\,dx\ll \int_{{\mathbb{R}}^3}\big(\rho(x)+\rho(x)^2\big)\,dx,\\[0.4cm]
