Solution (source code)

= Solution

For the same multiplier convention, the <Lagrangian dual problem> is
$$
q(\lambda)=\inf_{x\in X}[f(x)+\lambda^T(b-g(x))],\qquad
\boxed{\sup_{\lambda\in\mathbb R^m}q(\lambda).}
$$
For every feasible $x$ and every $\lambda$, the equality constraint implies $q(\lambda)\le L(x,\lambda)=f(x)$. Taking first the infimum over feasible $x$ and then the supremum over $\lambda$ proves <weak duality>:
$$
\boxed{d^*:=\sup_\lambda q(\lambda)\le p^*:=\inf_{x\in X,\ g(x)=b} f(x).}
$$
The inequalities remain meaningful with the usual extended-value conventions, including $q(\lambda)=-\infty$ when the Lagrangian is unbounded below. Equality of optimum values, or their attainment, does not follow from <weak duality>. If the sufficient pair in part (a) exists, it attains equality, since $q(\lambda^*)=L(x^*,\lambda^*)=f(x^*)$.