I've seen it explained several times[1] on this site that with $H_1: \theta > a$, then the correct form for the null hypothesis is $H_0: \theta \leq a$. But how can I use this $H_0$ to calculate a $p$-value?
For example, consider a random variable $X \sim N(\mu,1)$. I want to test $H_1: \mu > 0$. With $H_0: \mu = 0$ it is easy, since assuming $H_0$ allows me to calculate probabilities with the $N(0,1)$ distribution. But with $H_0: \mu \leq 0$, how does assuming $H_0$ enable me to calculate a probability? How can I calculate a $p$-value without first assuming a value for $\mu$ rather than an interval?
[1] For example: https://stats.stackexchange.com/a/177798
You are wanting to find the size of a test. For non simple hypotheses this is defined as $\text{sup}_{\theta \in H_0} W(\theta)$ where $W(\theta)$ is the power function: $W(\theta)=\mathbb{P}(\text{reject} H_0 | \theta)$