Strong duality without dual attainment (source code)

= Strong duality without dual attainment
{title2=$\sup_{\lambda\geq0}9\lambda/(1+\lambda)=9$}

Consider an <objective function> that is a <quadratic polynomial>, with a singular <optimization constraint>:
$$
\min_{x\in\mathbb R}(x-3)^2\qquad\text{subject to }x^2\leq0.
$$
Its only <feasible point> is $x_*=0$, giving $p_*=9$. For $\lambda\geq0$, <completing the square> yields
$$
L(x,\lambda)=(1+\lambda)\left(x-\frac3{1+\lambda}\right)^2
+\frac{9\lambda}{1+\lambda},\qquad
q(\lambda)=\frac{9\lambda}{1+\lambda}=9-\frac9{1+\lambda}.
$$
Every finite <Lagrange multiplier> gives $q(\lambda)<9$, but $q(\lambda)\to9$ as $\lambda\to\infty$. Thus $d_*=p_*=9$: <strong duality> holds, and the primal optimum is attained, yet <dual attainment> fails. The inner minimizers $3/(1+\lambda)$ approach $0$ without ever becoming feasible at finite $\lambda$.

Both the <objective function> and the constraint <function> are <convex functions>. However, <Slater's condition> fails because $x^2<0$ is impossible. At the optimum, stationarity would require $-6+\lambda\cdot0=0$, which no finite <Lagrange multiplier> satisfies. Compare <KKT regularity at a local minimum>: a zero <gradient> of an <active constraint> can prevent a multiplier certificate. This example has zero <duality gap> without the <Strong Lagrangian property>.