Hilbert space in Dirac's representation I've been reading some old posts here on physics stack exchange and I realized something that have never ocurred to me before.
Let $\mathscr{H}$ be a Hilbert space over $\mathbb{C}$. An orthonormal system is a family $\{e_{\alpha}\}_{\alpha \in I}$ of $\mathscr{H}$ such that $\langle e_\alpha, e_{\beta}\rangle =0$ if $\alpha \neq \beta$ and $\langle e_{\alpha},e_{\alpha}\rangle \equiv ||e_{\alpha}||^{2} = 1$. For simplicity, let us set $I = \mathbb{N}$ so that our orthonormal system is countably infinite. The sum:
\begin{eqnarray}
\sum_{n\in \mathbb{N}}\alpha_{k}e_{k} \quad \mbox{$\alpha_{n}\in \mathbb{C}$, for every $n\in \mathbb{N}$} \tag{1}\label{1} 
\end{eqnarray}
converges in $\mathscr{H}$ if, and only if:
\begin{eqnarray}
\sum_{n\in \mathbb{N}}|\alpha_{n}|^{2} <+\infty \tag{2}\label{2}
\end{eqnarray}
In this case, if $x= \sum_{n\in \mathbb{N}}\alpha_{n}e_{n}$, it can be proved that the coefficients $\alpha_{n}$ are given by $\alpha_{n}=\langle e_{n},x\rangle$, so that:
\begin{eqnarray}
x = \sum_{n\in \mathbb{N}}\langle e_{n},x\rangle e_{n}\tag{3}\label{3}
\end{eqnarray}
If, in addition, $\{e_{n}\}_{n\in \mathbb{N}}$ is a complete orthonormal system, which means that no other orthonormal system contains $\{e_{n}\}_{n\in \mathbb{N}}$ as a proper subset, every $x\in \mathscr{H}$ can be written as in (\ref{3}).
Now, let's go to quantum mechanics in Dirac's notation. Usually, one considers a Hilbert space $\mathscr{H}$ and elements its elements $|\psi\rangle$. Suppose $|x\rangle$ is an eigenfunction of the position operator $\hat{x}$.
\begin{eqnarray}
|\psi\rangle = \int dx \psi(x) |x\rangle \tag{4}\label{4}
\end{eqnarray}
This is an analogy to what is done in (\ref{3}), where, this time, the coefficients are given by:
$$\langle x| \psi \rangle = \psi(x)$$
As it turns our, $\psi(x)$ is the component of a state $|\psi\rangle$ in the Hilbert space $\mathscr{H}$, but it is precisely what one usually used when dealing with wave quantum mechanics, i.e. $\psi(x)$ is exactly what one obtains when solving time-independent Schrödinger's equation:
$$\bigg{[}-\frac{\hbar^{2}}{2m}\nabla^{2} + V(x)\bigg{]}\psi(x) = E\psi(x) $$
Now, here is my question.
When dealing with rigorous treatment of quantum mechanics, one usually sets the starting point to be the Hilbert space $L^{2}(\mathbb{R}^{d})$ (at least for the usual treatment of textbook problems). But this seems to be the appropriate Hilbert space for the coefficients $\psi(x)$, not the original abstract Hilbert space of vectors $|\psi\rangle$. Using the previous analogy, expression (\ref{3}) tells us that if $x \in \mathscr{H}$ then the coefficients $\alpha_{k}$ are elements of $\ell^{2}(\mathbb{N})$. So, is my analysis correct? In other words, is the Hilbert space $\mathscr{H}$ of Dirac vectors $|\psi\rangle$ an abstract Hilbert space, and the use of position eigenbasis demand the wavefunctions (coefficients $\psi(x)$) to be elements of another Hilbert space $L^{2}(\mathbb{R}^{d})$?
EDIT: It just ocurred to me that, in the cited exemple, the Hilbert space of states $|\psi\rangle$ should also be $L^{2}(\mathbb{R})$ to make sense of the operator $\hat{x}$ as a multiplication operator. In any way, the moral remains: the use of $L^{2}(\mathbb{R})$ as the space of wave functions $\psi(x)$ is independent of the Hilbert space of states $|\psi\rangle$ ?
 A: I think what you just discovered is that every (separable*) infinite-dimensional Hilbert space $\mathcal H$ is isometrically isomorphic to $\ell^2$. The isomorphism is given by mapping a vector $|\psi\rangle \in \mathcal H$ to the coefficient list $( \langle e_n | \psi \rangle )_n$.
In particular, $L^2(\mathbb R^d)$ is isomorphic to $\ell^2$. For example, the Hermite functions (the eigenstates of the quantum harmonic oscillator) form a countable orthonormal basis of $L^2(\mathbb R)$, any wavefunction can thus be represented by its expansion in Hermite functions.
Your confusion seems to stem from the position eigenstates $|x\rangle$, which look like an uncountable basis (and thus it might look like $L^2$ is different from $\ell^2$). However, they have "infinite" norm, are actually not elements of the Hilbert space and should be seen more as a convenient tool / trick for calculations.
*Separable means that the Hilbert space has a countable orthonormal basis. That is always assumed to be true in Physics.
A: The position eigenstates are not actually part of any Hilbert space at all.  A position eigenstate wave function with eigenvalue $x_{0}$ is $\psi(x)=\delta(x-x_{0})$.  If we try to normalize this, we need to calculate
$$\int_{-\infty}^{+\infty}dx\,|\psi(x)|^{2}=\int_{-\infty}^{+\infty}dx\,[\delta(x-x_{0})]^{2}=\delta(0)=\infty.$$
So this basis state is fundamentally not normalizable.  The same is true for the momentum eigenstates for a free particle; the plane wave $\psi(x)=e^{ip_{0}x/\hbar}$ is not normalizable on $-\infty<x<+\infty$.
So these wave functions are not actually part of the Hilbert space $L^{2}(\mathbb{R})$.  Instead, they are part of a larger space, known as the "rigged" Hilbert space.  Physical states correspond only to states of the true Hilbert space, but it is very frequently convenient to use bases (such as position or momentum eigenstate bases) that are not contained within the physical space.  The rigged space is a larger vector space (with an uncountable dimensionality), without a well-defined inner product (or even just a norm), so it is not a larger Hilbert space, just a vector space.
