Solution (source code)

= Solution

For a rejection function $\varphi(x)\in[0,1]$, its <power function of a statistical test>[power] is $\beta(\theta)=\mathbb E_\theta\varphi(X)$. A test has level at most $\alpha$ if $\sup_{\theta\in H_0}\beta(\theta)\le\alpha$; its size is that supremum. In a simple null the significance probability is just the rejection probability under that null.

For two simple hypotheses with joint sample <probability density function>[densities] $f_0,f_1$, the <Neyman-Pearson lemma>[Neyman–Pearson lemma] states that a test rejecting where $f_1>kf_0$, accepting where $f_1<kf_0$, and randomizing if necessary on equality to have size $\alpha$, is most powerful among level-$\alpha$ tests. Let $\varphi_*$ be that test and $\varphi$ any competitor. Pointwise,
$$
(\varphi_*-\varphi)(f_1-kf_0)\ge0.
$$
Integration gives
$$
\int(\varphi_*-\varphi)f_1\ge k\int(\varphi_*-\varphi)f_0\ge0,
$$
since $k\ge0$, the first test has size $\alpha$, and the other has size at most $\alpha$. This proves the claimed <power function of a statistical test>[power] bound, allowing null-<probability density function>[density]-zero regions as well. Equality implies agreement away from the <likelihood>-ratio boundary, up to null sets, when the inequalities are strict.