Let $\overline{H}$ be a Hilbert space and $A\in B\left( \overline{H}\right) $ be a surjective operator such that $A\left( H\right) =H$ and its restriction to $H$ is injective and. I'm asking if under these assumptions $A$ in invertible. All it remains is to show that $A$ is injective, but the problem is that I don't know how to take a direct complement subspace of $H$ in $\overline{H}$ to construct a bounded inverse of $A$.
To make the assumptions more precise :
$H$ is dense in $\overline{H}$.
$A\left( \overline{H}\right) =\overline{H}$
The restriction operator$\left. A\right\vert _{H}:H\rightarrow H$ is invertible, (not necessarily boundedly)
Let $S$ denote the shift operator acting on $\ell^2(\mathbb{N}_0)$ by $$S(x_0,x_1,\ldots)=(x_1,x_2,\ldots )$$ Then $S$ is surjective and $S(1,0,\ldots, 0\,\ldots)=0.$ Let $$V={\rm span}\{(\lambda^n)_{n=0}^\infty \,:\, 0<|\lambda|<1\}$$ The space $V$ is dense. Indeed if $v\perp (\lambda^n)$ for any $|\lambda|<1$ then $$f(\lambda):=\sum_{n=0}^\infty v_n\lambda^n=0,\quad 0<|\lambda|<1$$ The function $f(\lambda)$ is holomorphic, therefore $v_n=0$ for any $n.$ We have $S(V)=V,$ because $S(\lambda^n)_{n=0}^\infty =\lambda (\lambda^n)_{n=0}^\infty.$ The operator $S$ restricted to $V$ is injective as its kernel is one dimensional, and $(1,0,\ldots,0,\ldots)\notin V.$ Indeed assume $$(1,0,\ldots,0,\ldots)=a_1(\lambda_1^n)+\ldots +a_k(\lambda_k^n)$$ for distinct numbers $\lambda_1,\ldots,\lambda_k.$ Then $a_1+\ldots +a_k=1$ and $a_1\lambda_1^n+\ldots +a_k\lambda_k^n=0$ for any $n\ge 1.$ The latter implies $a_1+\ldots+a_k=0$ as the Vandermonde determinant of the numbers $\lambda_1,\ldots,\lambda_k$ is nonzero, a contradiction.