  This work presents an abstract framework for the design, implementation, and
analysis of the multiscale spectral generalized finite element method
(MS-GFEM), a particular numerical multiscale method originally proposed in [I.
Babuska and R. Lipton, Multiscale Model.\;\,Simul., 9 (2011), pp.~373--406].
MS-GFEM is a partition of unity method employing optimal local approximation
spaces constructed from local spectral problems. We establish a general local
approximation theory demonstrating exponential convergence with respect to
local degrees of freedom under certain assumptions, with explicit dependence on
key problem parameters. Our framework applies to a broad class of multiscale
PDEs with $L^{\infty}$-coefficients in both continuous and discrete, finite
element settings, including highly indefinite problems (convection-dominated
diffusion, as well as the high-frequency Helmholtz, Maxwell and elastic wave
equations with impedance boundary conditions), and higher-order problems.
Notably, we prove a local convergence rate of $O(e^{-cn^{1/d}})$ for MS-GFEM
for all these problems, improving upon the $O(e^{-cn^{1/(d+1)}})$ rate shown by
Babuska and Lipton.
  Moreover, based on the abstract local approximation theory for MS-GFEM, we
establish a unified framework for showing low-rank approximations to multiscale
PDEs. This framework applies to the aforementioned problems, proving that the
associated Green's functions admit an $O(|\log\epsilon|^{d})$-term separable
approximation on well-separated domains with error $\epsilon>0$. Our analysis
improves and generalizes the result in [M. Bebendorf and W. Hackbusch,
Numerische Mathematik, 95 (2003), pp.~1-28] where an
$O(|\log\epsilon|^{d+1})$-term separable approximation was proved for
Poisson-type problems.
