How do we show $\int_{[0,\:1)^2}\exp\left(-\frac{\left\|x-\frac{x_i+x_j}2\right\|^2}{\sigma^2}\right)\:{\rm d}x=\pi\sigma^2$ here

error functionexponential functionintegrationreal-analysis

Let $D=[0,\sqrt N)^d$ for some $N\in\mathbb N$, $x_i,x_j\in D$ and $\sigma>0$. In equation $(30)$ of this paper I've read that, if $d=2$, then \begin{equation}\begin{split}\int_D\exp\left(-\frac{\left\|x-\frac{x_i+x_j}2\right\|^2}{\sigma^2}\right)\:{\rm d}x&=\int_{\mathbb R^2}\exp\left(-\frac{\left\|x-\frac{x_i+x_j}2\right\|^2}{2\left(\sigma/\sqrt 2\right)^2}\right)\:{\rm d}x\\&=2\pi\frac{\sigma^2}2=\pi\sigma^2\end{split}\tag1\end{equation} as long as $\sigma\ll\sqrt N$ or "assuming an infinite periodic set".

How can we show this? I actually don't understand what's meant by "assuming an infinite periodic set". But even when $\sigma\ll\sqrt N$, I don't understand how we obtain the claim (at least approximately).

EDIT

So, okay. Let us write $z:=\frac{x_i+x_j}2$. We've then got $$\int_{\left[0,\:\sqrt N\right)^d}\exp\left(-\frac{\|x-z\|^2}{\sigma^2}\right)=\sqrt N^d\int_{[0,\:1)^d}\exp\left(-\frac N{\sigma^2}\left\|x-\frac z{\sqrt N}\right\|^2\right)\:{\rm d}x\tag2.$$ Now note that $$\sqrt N\int_0^1\exp\left(-\frac N{\sigma^2}\left(x-\frac{z_i}{\sqrt N}\right)^2\right)\:{\rm d}x=\frac{\sqrt\pi}2\sigma\left(\operatorname{erf}\left(\frac{z_i}\sigma\right)-\operatorname{erf}\left(\frac{z_i}\sigma-\frac{\sqrt N}\sigma\right)\right).\tag3$$ Now how does $\sigma\ll\sqrt N$ imply $(3)$ is equal to $\pi\sigma^2$? I guess we need to use $\frac{\sqrt N}\sigma\to\infty$ instead of $\sigma\ll\sqrt N$, but I still don't see how to deal with $\frac{z_i}\sigma$ in $(3)$ when I take this limit …

EDIT 2

Maybe we need to assume $\sigma=\delta\sqrt N$ and consider $\delta\to0+$ as suggested by FShrike in the comments. For this, note that $$\int_0^{\sqrt N}\exp\left(-\frac{(x-z_i)^2}{\sigma^2}\right)\:{\rm d}x=\sigma\int_{-\frac{z_i}{\sqrt N}\frac1\delta}^{\left(1-\frac{z_i}{\sqrt N}\right)\frac1\delta}e^{-x^2}\:{\rm d}x\tag3.$$ Now the integral on the right-hand side clearly tends to $\sqrt\pi$ as $\delta\to0+$. I guess this is why they say that $(3)$ is approximately equal to $\sqrt\pi\sigma$. However, since $\sigma\to0+$ as $\delta\to0+$, this is somehow strange.

So, that's why I would like to figure out the ofllowing: How small must $\delta$ actually be to make the error between $\sqrt\pi\sigma$ and $(3)$ smaller than a given $\varepsilon>0$; i.e. $$0<\sqrt\pi\sigma-\int_0^{\sqrt N}\exp\left(-\frac{(x-z_i)^2}{\sigma^2}\right)\:{\rm d}x<\varepsilon\tag4?$$

Best Answer

$\newcommand{\d}{\,\mathrm{d}}$Take $z$ to be in $(0,\sqrt{N})^2$ and $0<\sigma$. By the multivariate integral substitution rule we have: $$\int_{[0,\sqrt{N})^2}\exp(-\sigma^{-2}\|x-z\|^2)\d\lambda(x)\\=\sigma^2\int_{[-z_1/\sigma,(\sqrt{N}-z_1)/\sigma)\times[-z_2/\sigma,(\sqrt{N}-z_2)/\sigma)}\exp(-\|x\|^2)\d\lambda(x)$$

The difference between this and: $$\sigma^2\int_{\Bbb R^2}\exp(-\|x\|^2)\d\lambda(x)=\pi\sigma^2$$Is exactly: $$\psi(\sigma,N,z):=\sigma^2\int_{\Bbb R^2\setminus[-z_1/\sigma,(\sqrt{N}-z_1)/\sigma)\times[-z_2/\sigma,(\sqrt{N}-z_2)/\sigma)}\exp(-\|x\|^2)\d\lambda(x)$$We can bound: $$\begin{align}0&<\psi(\sigma,N,z)\\&\le\sigma^2\int_{\{|u|\ge\mu/\sigma\}\times\{|v|\ge\nu/\sigma\}}\exp(-\|(u,v)\|^2)\d\lambda(u,v)\\&\le4\sigma^2\int_{(\kappa/\sigma,\infty)^2}\exp(-\|(u,v)\|^2)\d\lambda(u,v)\end{align}$$Where $0<\mu:=\min(z_1,\sqrt{N}-z_1),\,0<\nu:=\min(z_2,\sqrt{N}-z_2)$ and $\kappa:=\min(\mu,\nu)>0$. We can continue to bound: $$\begin{align}\psi(\sigma,N,z)&\le4\sigma^2\exp(-2\kappa^2/\sigma^2)\int_{(\kappa/\sigma,\infty)^2}\exp(-(u^2-\kappa^2/\sigma^2+v^2-\kappa^2/\sigma^2))\d\lambda(u,v)\\&=4\sigma^2\exp(-2\kappa^2/\sigma^2)\left(\int_{\kappa/\sigma}^\infty\exp(-(x^2-\kappa^2/\sigma^2))\d x\right)^2\end{align}$$

If we substitute $y^2=x^2-\kappa^2/\sigma^2$ then $0\le\frac{\d x}{\d y}=\frac{y}{x}=\sqrt{1-\frac{\kappa^2}{\sigma^2x^2}}\le1$ so I can continue to bound: $$0<\psi(\sigma,N,z)\le4\sigma^2\exp(-2\kappa^2/\sigma^2)\left(\int_0^\infty\exp(-y^2)\d y\right)^2=\pi\sigma^2\cdot\exp(-2\kappa^2/\sigma^2)$$

Now - if $z$ is "pretty close" to the middle of the region, say we've fixed a constant $0<\alpha<1$ and $\alpha\sqrt{N}\le\min(z_1,z_2,\sqrt{N}-z_1,\sqrt{N}-z_2)$ and if $\sigma:=\delta\sqrt{N}$ for some defined $\delta>0$ then you've got: $$0<\left|\pi\sigma^2-\int_D\cdots\right|\le\pi\sigma^2\cdot\exp(-2\alpha^2/\delta^2)$$If $\delta\ll\alpha$ the right hand side is extremely small indeed. What's more, we're actually saying the right hand side is small even if you divide through by $\sigma^2$ (which is also very small). So the error clearly decays very fast, and the paper's heuristic is about as justified as a heuristic can be.