Solution (source code)

= Solution

Stationarity of the equality-constrained quadratic subproblem gives $B_ks_k+g_k-A_k^Ty_{k+1}=0$. Together with feasibility, this is
$$
\boxed{\begin{pmatrix}B_k&-A_k^T\\A_k&0\end{pmatrix}\begin{pmatrix}s_k\\y_{k+1}\end{pmatrix}=\begin{pmatrix}-g_k\\-c_k\end{pmatrix}.}
$$
Multiplying the bottom block row by $-1$ gives a symmetric indefinite <saddle-point matrix>, with right side $(-g_k,c_k)^T$.

One solution strategy uses the <Schur complement>. From $s_k=B_k^{-1}(A_k^Ty_{k+1}-g_k)$ obtain
$$
\boxed{(A_kB_k^{-1}A_k^T)y_{k+1}=A_kB_k^{-1}g_k-c_k.}
$$
This is an $m\times m$ positive-definite system when $A_k$ has full row rank; factor $B_k$ and solve with it rather than forming its inverse.

A second strategy uses a <nullspace> basis $Z$ for $\ker A_k$. Choose one particular $s_p$ with $A_ks_p=-c_k$, write $s_k=s_p+Zz$, and solve the reduced system
$$
\boxed{Z^TB_kZz=-Z^T(g_k+B_ks_p).}
$$
The <reduced Hessian> is positive definite. These range-space and nullspace reductions exploit different relative sizes of $m$ and $n-m$.