My doubt is the following, when you create an orthonormal basis for a space, the number of coefficients in each vector, and the number of vectors is equal to the dimension of the space (at least in finite dimensional spaces). For example the standard basis for $\mathbb{R}^3$ is $(1,0,0),(0,1,0),(0,0,1)$.
What happens when we consider infinite dimensional Hilbert spaces?
For instance, let $\mathcal{L}_2(-\pi ,\pi) $ be the collections of functions $\chi =\{x(t):-\pi \leq t \leq \pi\}$ for which $\int_{-\pi}^{\pi}|x^2(t)|dt<\infty$. Define the vector addition and scalar multiplication coordinatewise such that we end up with a Hilbert space.
My text book says that there's a set of vectors $\{z_n:n=0,\pm1,...\}$ that is a complete orthonormal sequence in $\mathcal{L}_2(-\pi ,\pi)$.
My question is, I know that every single $x(t)$ has an infinite dimension, since we are considering a continuous function, but not countable infinite, while the number of vectors $z_n$ is clearly countable infinite.
That makes me think, isn't necessary that the number of components in a vector of the "basis" and the number of vectors that form the latter coincide?
Hopefully you will shed some light on the problem.
Your intuition is that a function $x=x(t)$ is identified by its values at each point $t\in[-\pi, \pi]$. In other words, you propose the following basis for the space $L^2([-\pi , \pi])$; $$ \{ e_{t_0}\ :\ t_0\in[-\pi, \pi]\}, $$ where we define $$ e_{t_0}(t):=\begin{cases} 1, & t=t_0,\\ 0, & t\ne t_0, \end{cases}$$ in analogy with the standard basis $\{e_j\ :\ j=1,\ldots,n\}$ of $\mathbb R^n$.
This is a very natural intuition, but there is a subtlety; the elements of $L^2([-\pi, \pi])$ really are equivalence classes of functions, up to equality at almost all points (that is, two functions are considered equal if they agree up to a set of measure zero). Now, all functions $e_{t_0}$ are equal to zero at almost all points, so they count as the null function in $L^2$. This is where your intuition breaks down.