So I am a newbie to QM, and coming from math, I believe I am not understanding some key points in bra-ket notation.
So given a quantum state $\psi$, I understand that $|\psi \rangle$ is a just a Hilbert space notation for a function. Now, we say that $$\langle \psi_n | \psi_m \rangle = \int \psi_n^* \psi _m dr$$ Which leads me to believe that the $\langle \cdot | \cdot \rangle$ notation seems to imply that it is a inner product defined on the space. However, then I see that $$\psi (r) = \langle r | \psi \rangle$$ and $$\psi^* (r) = \langle \psi | r \rangle$$ for some position vector $r$, with dimension $3$. Well, if that is the case, of course it isn't just a normal inner product defined on functions. It is something else, not quite sure yet. It does seem like $\langle \psi |$ seems to be the conjugate transpose of the function/vector/state $\psi$. Then I see the following identity, $$\int dr | r \rangle \langle r | = I$$ where $I$ is the identity operator. I don't understand this. How do you get this statement from the above statements? Imagining $r$ to be vectors in $\mathbb{R}^3$, I can see that $rr^T$ leads to a matrix, but I don't see it leading to the identity matrix. What am I missing here? What kind of a product is this final identity?
I also see these identities later in the book: $$|\psi \rangle = \int dr |r\rangle \langle r| \psi \rangle \\ |\psi \rangle = \int dr |p\rangle \langle p| \psi \rangle \\ |\psi \rangle = \int dr | \psi_E \rangle \langle \psi_E| \psi \rangle $$ followed by expectation values of operators, like $$\langle \hat{A} \rangle = \langle \psi | \hat{A} | \psi \rangle$$
Expectation value is $\langle Y \rangle = \int p(x) Y dx$, where $p(x)$ is the probability distribution function. I see that $\langle \psi | \psi \rangle$ gives me the probability distribution, but does that mean the operator $\hat{A}$ is just chilling there? Doing nothing really?
I understand that this looks like forming the vector from the basis, but I don't seem to understand how these operators work, and how I can draw analogies to standard vector spaces like $\mathbb{C} ^n$ or something.
Any advice you have would be appreciated.