Well, this question shows that linear algebra is just neccesary in physics.
There are so many issues in this question. First of all, it's true that $|a\rangle$ is a vector, but nobody said it was a three dimensional vector. It is a vector that can have any dimension, even infinite dimension (infinite rows), or even a continous of rows.
That's because a vector is just defined as "al element of a vector space", which is itself a "set of elements and two operations, an internal one (sum) and an external one (product of scalar times vector), such that the first one makes a group, and the second one verifies 4 axioms". That was a really short summary. Make yourself the research about "what a vector space is". It's in wikipedia for sure.
So, besides the usual arrows, there are many things that are vectors (or can be regarded as vectors). Some examples are
- Matrices
- The real numebrs themselves, or also complex numbers.
- n-tuples of numbers ($\mathbb{R}^2,\ \mathbb{R}^3, ..., \mathbb{R}^n...)$
- Linear functions
And let's higlight that one. Linear functions are also vectors. It can sound weird, but they are, because
- There's a set of "linear functions", and two operations like above (sum of functions and product of number times function). And they satisfy all required properties. I'll sumarise them with formulas:
Let $f$, $g$, and $h$ be functions of the vector space $\mathcal{F}$, and $t,s$ scalars... then
- $\quad f+g\in \mathcal{F}$
- $\quad f+g=g+f$
- $\quad f+(g+h)=(f+g)+h$
- $\quad f+0=f$
- $\quad \exists (-f)\ \ \quad /\ \quad \ f+(-f)=0=(-f)+f$
- $\quad t\cdot(f+g)=tf+tg$
- $\quad (t+s)\cdot(f)=tf+sf$
- $\quad t\cdot(sf)=(t\cdot s)g$
- $\quad 1\cdot f=f$
Where 0 denotes the "void function".
So you can see that functions behave like arrow vectors. Linear functions can be seen as vectors. The fact that functions satisfy these prperties inmediately means that they satisfy all theorems of vectors.
What's more, we can define more operations. There exists a "scalar product" of two linear functions, and it is defined as
$$ \vec{f}\cdot \vec{g} = \int_{-\infty}^{+\infty}{f(x)\cdot g(x) dx} $$
It can be shown that this definition satisfies the three properties of a scalar product, so it is a valid scalar product for functions.
If functions are complex, then f must appear conjugated in the integrand.
Altough there are so many more issues concerning Hilbert space of kets (dirac notation), let's conclude here:
functinos behave like vectors. The scalar product of two functions is defined via the previous integral.
So vectors are not an integral. The scalar product of two vectors is a number, and so is a defintie integral.
Finally, what we do is "defining kets" so that their scalar product gives the same result as the scalar product of their associated wavefunctions.