Solution (source code)

= Solution

Writing $P,Q$ for the laws of $X,Y$, respectively, and using <Jensen inequality> for the concave <natural logarithm>,
$$
\begin{aligned}
\mathbb E_Pg-D_e(P\Vert Q)
&=\sum_xP(x)\log_e\frac{e^{g(x)}Q(x)}{P(x)}\\
&\leq\log_e\sum_xP(x)\frac{e^{g(x)}Q(x)}{P(x)}\\
&=\log_e\mathbb E_Qe^{g(Y)}.
\end{aligned}
$$
This is the lower-bound half of the <Gibbs variational principle for relative entropy>.

Solved by gpt-5.6-sol high.