Optimization in infinite-dimensional Hilbert spaces