Solution (source code)

= Solution

For $\mathcal L=f-y^Tc$, the inequality-constrained <Karush-Kuhn-Tucker conditions> are
$$
\boxed{c(x_*)\geq0,\quad y_*\geq0,\quad C(x_*)y_*=0,\quad g(x_*)-A(x_*)^Ty_*=0.}
$$
Under an appropriate <constraint qualification>, the second-order necessary condition is $d^TH(x_*,y_*)d\geq0$ on the <critical cone>
$$
\mathcal C=\{d:A_i(x_*)d\geq0\text{ for active }i,\quad g(x_*)^Td=0\}.
$$
Equivalently active constraints with positive multiplier require $A_id=0$, while active zero-multiplier constraints retain $A_id\geq0$. Inactive constraints impose no first-order tangent restriction. This distinction is why the relevant cone need not be the nullspace of every active row.