I was reading Statistical Inference (2nd edition) by George Casella & Roger L. Berger when I came across a formal definition of p-value, followed by a theorem stating that
Let W(X) be a test statistic such that large values of W give evidence that $H_1$ is true. For each sample point x, define $$p(x)=\sup_{\theta \in \Theta_0} P_{\theta}(W(X) \geq W(x))$$ Then, p(X) is a valid p-value.
My question is what if the test statistic is the one whose small values give evidence that $H_1$ is true? Is the $p$-value defined as $\inf_{\theta \in \Theta_0} P_{\theta}(W(X) \leq W(x))$ in that case? Thank you a lot.