Text this: A rigorous derivation of the Hamiltonian structure for the nonlinear Schrödinger equation