Computing distance of a non-singular matrix from the space of singular matrices. $M_n$ is the space of $n\times n$ matrices with entries in $\mathbb R$. $GL_n\subset M_n$ is the space of all invertible matrices.  Let $A\in {GL}_n$. I want to show that $$\inf_{B\text{ is singular}}\| A-B\|_2=\frac{1}{\|A^{-1} \|_2}$$Here's what I have tried so far: 
First of all since $\|A-B \|_2\geq \|B\|_2-\|A\|_2$, the infemum is attained at some point say $B_0$. Then I tried using the method of Lagrange multipliers and considered the function $$F:M_n\times \mathbb R\rightarrow \mathbb R $$ $$(B,\lambda)\mapsto \|B-A \|_2^2+\lambda \det B$$$\frac{\partial F}{\partial\lambda}=\det B$ $\frac{\partial F}{\partial B_{ij}}=2(B_{ij}-A_{ij})+\lambda (-1)^{i+j}B^{ij}$ where $B^{ij}$ is the $(i,j)$th co-factor. 
I want to solve the equations $\frac{\partial F}{\partial\lambda}=0,\frac{\partial F}{\partial B_{ij}}=0$ but I am stuck there. Also I cannot think of any other way too approach this problem. Thanks for your help.
 A: In a more general setting, consider any operator norm $\|\cdot\|$ induced by a vector norm (which we also denote by $\|\cdot\|$). If $A+H$ is singular, then $HA^{-1}x=-x$ for some nonzero vector $x$. Therefore
$$
\|H\|\|A^{-1}\|\|x\|\ge\|HA^{-1}x\|=\|-x\|=\|x\|
$$
and in turn $\|H\|\ge\|A^{-1}\|^{-1}$. To prove that the lower bound is attainable, define the dual norm of $\|\cdot\|$ as well as the dual norm of the dual norm by
$$
\|v^T\|_\ast=\max_{\|u\|=1}v^Tu,
\quad\|u\|_{\ast\ast}=\max_{\|v^T\|_\ast=1}v^Tu.
$$
In $\mathbb R^n$, it is known that the dual norm of dual norm is the primal norm, i.e. $\|\cdot\|_{\ast\ast} =\|\cdot\|$. Let $x$ be a unit vector such that $\|A^{-1}\|=\|A^{-1}x\|$. Let $u=\frac{A^{-1}x}{\|A^{-1}x\|}$ and $y^T=\arg\max_{\|v^T\|_\ast=1}v^Tu$. By definition, we have $\|y^T\|_\ast=1$ and $y^Tu=\|u\|_{\ast\ast}=\|u\|=1$. Now define
$$
H=-\|A^{-1}\|^{-1}xy^T.
$$
Then $(A+H)A^{-1}x=x-xy^T\frac{A^{-1}x}{\|A^{-1}\|}=x-xy^Tu=x-x=0$. Hence $A+H$ is singular. Also,
\begin{aligned}
\|H\|
&=\max_{\|z\|=1}\|Hz\|\\
&=\max_{\|z\|=1}\left\|\|A^{-1}\|^{-1}xy^Tz\right\|\\
&=\|A^{-1}\|^{-1}\|x\|\max_{\|z\|=1}|y^Tz|\\
&=\|A^{-1}\|^{-1}\|x\|\|y^T\|_\ast\\
&=\|A^{-1}\|^{-1}.
\end{aligned}
Hence the lower bound $\|A^{-1}\|^{-1}$ for the distance from $A$ to the nearest singular matrix is attainable.
In your case, since the norm in question is the induced $2$-norm, the proof can be made significantly simpler. Once you have shown that $\|H\|$ is necessarily bounded below by $\|A^{-1}\|^{-1}$, you may show that the lower bound is attainable by considering $H=-\|A^{-1}\|^{-1}xy^T$ with $y=\frac{A^{-1}x}{\|A^{-1}x\|_2}$. There is no need to consider any dual norm.
