Background
From what knowledge of quantum mechanics I have so far, it is a postulate that Hermitian operators corresponding to a certain observable act on a quantum state $\psi$ to produce a new quantum state. The eigenstates of these operators are the states with a definite value for the observable and the eigenvalue for each eigenstate is this definite value.
We also know that $\hat{H}$ is the operator corresponding to the energy. This means it should act on a state with definite energy to produce the value of the energy times this state. $\hat{H}$ acting on a general state (not necessarily an energy eigenstate) basically differentiates the state with respect to time (with an $i$ and a $\hbar$ thrown in).
So when solving a problem in QM we could find the energy eigenstates $\psi_{i}$ through the equation $\hat{H} \psi_{i} = E_i \psi_{i}$. We could also find the time evolution of an arbitrary state $\psi$ through the equation $\hat{H} \psi = i\hbar \frac{\partial \psi}{\partial t}$.
Now, the classical Hamiltonian of a particle that is in a potential is $H = \frac{p^2}{2m} +V(x)$. In a few YouTube videos I have seen on solving the Schrodinger equation, they say that this means the Hamiltonian operator for the quantum analog of this system must be $\frac{\hat{p}^2}{2m} + V(x)$ where $\hat{p}$ is the momentum operator. So that means the equation $\hat{H} \psi = i\hbar \frac{\partial \psi}{\partial t}$ turns into $\frac{\hat{p}^2}{2m} \psi + V(x) \psi = i\hbar \frac{\partial \psi}{\partial t}$ which means $ -\frac{\hbar^2}{2m} \frac{\partial ^2 \psi}{\partial x ^2} + V(x) \psi = i\hbar \frac{\partial \psi}{\partial t}$ after substituting for $\hat{p}$
The Question
My question is this:
- How do we justify (mathematically or using some postulates of quantum or classical mechanics) that we can just replace the $p$s in the classical Hamiltonian formula with $\hat{p}$ operators to get the quantum Hamiltonian operator $\hat{H}$?
Edit 1: I now understand the derivation of the momentum operator as the generator for translation. So I removed that from my question.