Text this: Formal analysis of state estimation for nonlinear model predictive control