---
tag: 5F4JG2980G
kind: proof
name: Proof of the Neyman–Pearson lemma
msc: [62F03]
proves: 0EE19CFEEF
uses: [087P03NEND, 05FSTXM92W, 0R41PVFA39, 0WF4EJP91W, 04YG690N5V]
sources:
  - url: https://en.wikipedia.org/wiki/Neyman–Pearson_lemma
    locator: Proof
---

## Proof

We compare the likelihood-ratio region with another region through one pointwise inequality, and then integrate it.

1. Let $f_0(x) = L(\theta_0 \mid x)$ and $f_1(x) = L(\theta_1 \mid x)$ be the [[likelihoods|05FSTXM92W]]. They are [[probability mass functions|0WF4EJP91W]] or [[densities|04YG690N5V]] of the data $X$ under $\theta_0$ and $\theta_1$. Write $\int g$ for the sum over $x$ or the integral in $x$ of a function $g$.
2. A [[hypothesis test|087P03NEND]] rejects $H_0$ when $X$ lies in a rejection region $R$. Its size is $P_{\theta_0}(X \in R) = \int 1_R f_0$, and its power at $\theta_1$ is $P_{\theta_1}(X \in R) = \int 1_R f_1$, as for [[type I and type II errors|0R41PVFA39]].
3. Let $R^* = \set{x : f_0(x) \le \eta f_1(x)}$. Where $f_1(x) > 0$, this is the condition $\Lambda(x) \le \eta$. Where $f_1(x) = 0$ and $f_0(x) > 0$, the point is not in $R^*$. There $\Lambda(x) = +\infty > \eta$, so the test does not reject either.
4. Let $N = \set{x : f_0(x) = f_1(x) = 0}$. Then $\int 1_N f_0 = \int 1_N f_1 = 0$. So the convention for $\Lambda$ on $N$ changes no probability, and the likelihood-ratio test has size $\alpha = \int 1_{R^*} f_0$ and power $\int 1_{R^*} f_1$.
5. Let $R$ be the rejection region of another test with size $\int 1_R f_0 \le \alpha$. Let $h(x) = \left(1_{R^*}(x) - 1_R(x)\right) \left(\eta f_1(x) - f_0(x)\right)$.
6. Claim: $h(x) \ge 0$ for every $x$. If $x \in R^*$, then $1_{R^*}(x) - 1_R(x) \ge 0$, and $\eta f_1(x) - f_0(x) \ge 0$ by the definition of $R^*$.
7. If $x \notin R^*$, then $1_{R^*}(x) - 1_R(x) \le 0$, and $\eta f_1(x) - f_0(x) < 0$. In both cases the product is at least $0$.
8. The function $h$ is bounded in absolute value by $\eta f_1 + f_0$, which has finite integral $\eta + 1$. So $\int h$ exists, and $\int h \ge 0$ by step 6 and 7.
9. Expand the product: $\int h = \eta \left(\int 1_{R^*} f_1 - \int 1_R f_1\right) - \left(\int 1_{R^*} f_0 - \int 1_R f_0\right)$.
10. The second bracket equals $\alpha - \int 1_R f_0 \ge 0$, since the size of $R$ is at most $\alpha$.
11. By steps 8 to 10, $\eta \left(\int 1_{R^*} f_1 - \int 1_R f_1\right) \ge \alpha - \int 1_R f_0 \ge 0$.
12. Since $\eta > 0$, $\int 1_{R^*} f_1 \ge \int 1_R f_1$. That is, $P_{\theta_1}(X \in R^*) \ge P_{\theta_1}(X \in R)$.
13. So no test of size at most $\alpha$ has a larger power at $\theta_1$ than the likelihood-ratio test. Since the likelihood-ratio test itself has size $\alpha$, it is a most powerful test of size $\alpha$.

## Idea

The likelihood-ratio region collects exactly the points where $f_1$ is large compared with $f_0$, at the exchange rate $\eta$. Any other region of no larger size must trade some of these points for points where $f_1$ is smaller relative to $f_0$. One pointwise inequality, integrated, shows that this trade cannot raise the power.
