Provably Correct Optimization And Estimation: Continuous, Discrete, And Dynamical