Let $n \ge 3$ be an integer and let $X=(X\_1,\ldots,X\_n)$ be random vector with iid coordinates from $N(0,1)$. For $1 \le k \le n$, let $X\_{(k)}$ be the value of the $k$th largest coordinate of $X$.



> 
> **Question.** What are good (anti-)concentration inequalities for $X\_{(1)} - X\_{(2)}$ ?
> 
> 
> 


References welcome!


A crude concentration inequality
--------------------------------


Note that $X\_{(1)} - X\_{(2)} \le \Delta := \max\_{i,j} X\_i - X\_j = X\_{(1)} - X\_{(n)}$. Moreover, $E[\Delta] \le 2\max\_i X\_i \le 2\sqrt{2\log n},$ and so using the result from [this post](https://math.stackexchange.com/a/3960057/168758), we have


$$
\begin{split}
P(X\_{(1)} - X\_{(2)} &\ge 2\sqrt{2 \log n} + t) \le P(\Delta \ge E[\Delta] + t)\\
&\le 2 P(|\max\_i X\_i - \mathbb E[\max\_i X\_i]| \ge t/2) \le 2e^{-t^2/8}.
\end{split}
$$


I wonder if my above somewhat naive bounds can be improved.


Edit: $P(X\_{(1)} - X\_{(2)} > t)$ when $n \ge 3$ and $t \ge 4 \sqrt{2 \log n}$
-------------------------------------------------------------------------------


Inspired by the posted answers and the above Borell-TIS inequality, one may compute
$$
\begin{split}
P(X\_{(1)} - X\_{(2)} > t) &\le P(X\_{(1)} > E X\_{(1)} + t/2) + P(X\_{(2)} < E X\_{(1)} - t/2)\\
&\le e^{-t^2/8} + P(X\_{(2)} < \sqrt{2 \log n} - t/2)\\
&= e^{-t^2/8} + P(X\_{(2)} \le -t/4), \text{ if }t \ge 4\sqrt{2 \log n}\\
&= e^{-t^2/8} + (\Phi(-t/2))^n + n(1 - \Phi(-t/4))\cdot (\Phi(-t/4))^{n-1}\\
&=e^{-t^2/8} + (\Phi^c(t/4))^n + n\Phi(-t/4)\cdot (\Phi^c(t/4))^{n-1} \\
&\le e^{-t^2/8} + (\Phi(t/4)+n\Phi(-t/4))\cdot e^{-(n-1)t^2/16}\\
&\le e^{-t^2/8}+(1+n/2)e^{-(n-1)t^2/16} \le 2e^{-t^2/8}, \text{ if }n \ge 3.
\end{split}
$$


We deduce that



> 
> If $n \ge 3$ and $ t \ge 4\sqrt{2 \log n}$, then we have the concentration inequality
> $$
> P(X\_{(1)} - X\_{(2)} \ge t) \le 2e^{-Ct^2}.
> $$
> 
> 
> 



Concentration and anti-concentration of gap between largest and second largest value in Gaussian iid sample
Let us show that, after proper rescaling, $X\_{(1)}-X\_{(2)}$ has an asymptotically exponential distribution.


Let $Y\_n:=X\_{(1)}$ and $Y\_{n-1}:=X\_{(2)}$. By the known formula for the [joint pdf of two order statistics](https://en.wikipedia.org/wiki/Order_statistic#The_joint_distribution_of_the_order_statistics_of_an_absolutely_continuous_distribution), the joint pdf of $Y\_{n-1}$ and $Y\_n$ is given by
\begin{equation}
 f\_{n-1,n}(y\_{n-1},y\_n)=n(n-1)F(y\_{n-1})^{n-2}f(y\_{n-1})f(y\_n)\,1(y\_{n-1}<y\_n),
\end{equation}
where $F$ and $f$ denote, respectively, the cdf and pdf of $N(0,1)$.
Hence, for any fixed real $c>0$,
\begin{equation}
 x:=\frac c{\sqrt{2\ln n}},
\end{equation}
\begin{equation}
 l:=\ln n,
\end{equation}
and all large enough $n$
we have
\begin{equation}
 P(X\_{(1)}-X\_{(2)}>x)=P(V>x)=n(n-1)J,
\end{equation}
where
\begin{align\*}
 J&:=\int\_{-\infty}^\infty dw\,F(w)^{n-2}f(w)\int\_x^\infty dv\, f(v+w) \\
& =\int\_{-\infty}^\infty dw\,F(w)^{n-2}f(w)G(x+w) \\ 
& =\int\_0^1 du\,h(u)=J\_2+O(J\_1+J\_3),
\end{align\*}
\begin{equation}
 h(u):=u^{n-2}G(x+Q(u)),\quad G:=1-F,\quad Q:=F^{-1}, 
\end{equation}
\begin{equation}
 J\_1:=\int\_0^{1-l^2/n}du\,u^{n-2}\le(1-l^2/n)^{n-2}\le\exp\Big\{-\frac{n-2}n\,l^2\Big\}
=o(1/n^2) 
\end{equation}
(as $n\to\infty$),
\begin{equation}
 J\_3:=\int\_{1-1/(nl)}^1du\,u^{n-2}G(Q(u))=\int\_{1-1/(nl)}^1du\,u^{n-2}(1-u)
 \le\frac1{nl}\,\int\_0^1 du\,u^{n-2}=o(1/n^2),
\end{equation}
and
\begin{equation}
 J\_2:=\int\_{1-l^2/n}^{1-1/(nl)} du\,u^{n-2}G(x+Q(u)). 
\end{equation}


For $u\in[1-l^2/n,1-1/(nl)]$ and $w:=Q(u)$, we have $u\uparrow1$ and hence $w\to\infty$; therefore and because $x\downarrow0$, again for $u\in[1-l^2/n,1-1/(nl)]$,
\begin{equation}
 G(x+Q(u))=G(x+w)\sim\frac{f(x+w)}{x+w}\sim\frac{f(w)}{w}\,e^{-xw}
 \sim G(w)\,e^{-xw}=(1-u)e^{-xw}, 
\end{equation}
and also
\begin{equation}
 |\ln(1-u)|\sim\ln n 
\end{equation}
and
\begin{equation}
 w=Q(u)\iff u=F(w)\iff 1-u=G(w)\implies w\sim\sqrt{2|\ln(1-u)|},
\end{equation}
since $G(w)=\exp\{-w^2/(2+o(1))\}$ as $w\to\infty$.
It follows that
\begin{align\*}
 J\_2&\sim\int\_{1-l^2/n}^{1-1/(nl)} du\,u^{n-2}(1-u)e^{-xQ(u)} \\ 
 &=\int\_{1-l^2/n}^{1-1/(nl)} du\,u^{n-2}(1-u)\exp\Big\{-\frac c{\sqrt{2\ln n}}\,\sqrt{2\ln n}\Big\} \\ 
 &=\int\_{1-l^2/n}^{1-1/(nl)} du\,u^{n-2}(1-u) e^{-c} \\ 
 &=\int\_0^1 du\,u^{n-2}(1-u) e^{-c}+O(J\_1+J\_3) \\ 
 &=\frac{e^{-c}}{n(n-1)}+O(J\_1+J\_3)\sim\frac{e^{-c}}{n(n-1)}. 
\end{align\*}


Collecting pieces, we conclude that for any fixed real $c>0$
\begin{equation}
 P\Big(X\_{(1)}-X\_{(2)}>\frac c{\sqrt{2\ln n}}\Big)\to e^{-c},
\end{equation}
so that indeed, after proper rescaling, $X\_{(1)}-X\_{(2)}$ has an asymptotically exponential distribution.


