Suppose that we want to test the mean of a normal population. Let $X_1,\dots,X_n\overset{i.i.d.}\sim N(\mu,1)$ (for simplicity, I'm assuming $\sigma^2 = 1$. Suppose that we are testing $H_0:\mu = \mu_0$ against the alternative $H_1:\mu\neq \mu_0$. We are looking for a rejection region of the form $|\overline{X}-\mu_0|>c$.
Therefore \begin{eqnarray*} P_{\mu_0}(|\overline{X}-\mu_0|>c) &=& \alpha\\ \text{i.e.,}\quad P_{\mu_0}(\sqrt{n}(|\overline{X}-\mu_0|)>c\sqrt{n}) &=& \alpha \end{eqnarray*} This implies that $c\sqrt{n} = z_{{\alpha}/{2}}$.
Thus we arrive at a test that calls for rejection of the null-hypothesis if $\sqrt{n}(|\overline{X}-\mu_0|) >z_{{\alpha}/{2}}$.
In this test, why is the p-value \begin{equation} \label{p-val} P(|Z|>\text{TS}), \end{equation} where $\text{TS} = \sqrt{n}(|\overline{X}-\mu_0|)$?
Although it looks intuitively alright, I am just wondering if there is a mathematical rigorous sequential way of obtaining the above formula?
PS: I asked this question in statistics stack exchange, where I couldn't get a convincing answer.
Yes, there is!
First way, analytical
Using the Generalized Likelihood Ratio you get that
$$\sup_{\theta \in \Theta_0}L\propto\exp\left\{\frac{1}{2}\Sigma_i(x_i-\mu_0)^2 \right\} $$
$$\sup_{\theta \in \Theta}L\propto\exp\left\{\frac{1}{2}\Sigma_i(x_i-\overline{x}_n)^2 \right\} $$
Do the ratio, manipulate is algebraically (try because it is not difficult) and get the desired solution
Second way, using a property of Gaussian model
If the model is gaussian, in the two tails hypothesis test there is a well known method known as "Confidence interval method" by which you calculate the confidence interval of $\mu\in [a;b]$ with the desired confidence level $(1-\alpha)100\%$
You use the following decision rule: Reject $H_0$ if and only if $\mu_0 \notin [a;b]$
Following this method you get exactly the solution you want to prove
Finally observe that this test IS NOT a UMP test.