The gap function on the space of compact Riemannian manifolds with boundary
is defined as the difference of the first two Dirichlet eigenvalues, where the
Riemannian metric is rescaled so that the diameter of the manifold is 1.
Estimating the gap function is known as the {\it gap problem}. Our main theorem
reduces the gap problem for domains in $\R^n$ to a certain Neumann problem in
$\R^{n+1}$. The infinitesimal version of this is related to Bakry-\'Emery
geometry; our second theorem embeds the Dirichlet gap problem into a certain
Bakry-\'Emery Neumann problem.
Let $\Omega_0$ be a polygon in $\RR^2$, or more generally a compact surface
with piecewise smooth boundary and corners. Suppose that $\Omega_\e$ is a
family of surfaces with $\calC^\infty$ boundary which converges to $\Omega_0$
smoothly away from the corners, and in a precise way at the vertices to be
described in the paper. Fedosov \cite{Fe}, Kac \cite{K} and McKean-Singer
\cite{MS} recognized that certain heat trace coefficients, in particular the
coefficient of $t^0$, are not continuous as $\e \searrow 0$.