I am studying eigenvalues and eigenvectors of operators on infinite-dimensional spaces, and I am struggling to understand generalized eigenvectors.
In order to explain myself better, I'm going to refer to an exercise we did during class. We had to find a basis for $L^2(R)$ using eigenvectors and generalized eigenvectors of the operator $P=-i\frac{d}{dx}$ defined on $D=\{f, f' \in L^2(R), f \space absolutely\space continuous\}$. In this way, P is self-adjoint. So we use the eigenvalues equation: $$-i\frac{df}{dx}=\lambda f$$ And we find the eigenvectors: $$f_n=a_\lambda e^{i\lambda x}$$ where $\lambda$ is a real number and $a_\lambda$ is a coefficient. These functions though $\notin L^2(R)$, so they're generalized eigenvectors and they're part of the continuous spectrum.
And this is the part I didn't understand. First of all, during lesson, my professor said that generalized eigenvectors are not functions but distributions.
My first doubt is the following: she said that $L^2(R) \subset S'(R)$ (where $S'(R)$ is the space of tempered distributions) and that $L^2(R)$ is dense in $S'(R)$. So, I know distributions are also known as generalized functions, but I really don't understand why, and I don't understand in which way we can say that $L^2(R)$ that is a space of functions can be included in a space of distributions. So, in particular, knowing that the generalized eigenvector we found should be a distribution, I don't understand how $f_n=a_\lambda e^{i\lambda x}$ can be seen as a distribution.
I get the idea that $$\int_{-\infty}^{+\infty}|f_n(x)|^2dx$$ is infinite, while $$\int_{-\infty}^{+\infty}|f_n(x)\phi(x)|^2dx$$ where $\phi$ is a test function, is finite. But we defined a distribution as follows: $$T_f(\phi)=\int_{-\infty}^{+\infty}f(x)\phi(x)dx$$ So if T is defined as that integral, how can it be seen as a function?
In addition, we also said that, for a self-adjoint operator, the set of the eigenvectors united to the set of the generalized eigenvectors forms an orthogonal basis of $L^2(R)$: but how is it possible that the generalized eigenvectors, which are not in $L^2(R)$, are a part of its basis?