Solution (source code)

= Solution

With $L(x,y)=f(x)-y^Tc(x)$, the <Karush-Kuhn-Tucker conditions> are
$$
\boxed{\nabla f(x_*)-Dc(x_*)^Ty_*=0,\quad c(x_*)\geq0,\quad y_*\geq0,\quad y_{*,i}c_i(x_*)=0\quad\text{for all }i.}
$$
Under a suitable <constraint qualification>, such as the <linear independence constraint qualification> on active constraint gradients, they are necessary for a local minimum. Smoothness alone is insufficient. The sign convention here corresponds to constraints written as $c_i\geq0$ and a minus sign in the <optimization Lagrangian>.