Confidence interval for the population proportion

Suppose that X is a binomial random variable of n trials, with probability p of success on a trial. Here is a supplementary explanation of the textbook's claim that the 100(1-alpha)% confidence interval for p, defined by a sample value x of X, is [pL, pU], where the numbers pL and pU are characterized by the equations (6.1) and (6.2). These two equations are equivalent to the statments

If X ~ B(n, pL), then P(X >= x) = alpha/2
If X ~ B(n, pU), then P(X <=x) = alpha/2

Our explanation is in terms of the normal approximation. If X ~ B(n,p), then for n sufficiently large we know that (X - np)/sqrt(npq) is approximately a standard normal. Divide through by n and let phat = X/n denote the sample proportion. Then

alpha = P(-Z1-alpha/2 <= (phat - p)/sqrt(pq/n) <= Z1-alpha/2)
= P(-Z1-alpha/2sqrt(pq/n) <= phat - p <= Z1-alpha/2 sqrt(pq/n))
= P(-phat - Z1-alpha/2sqrt(pq/n) <= - p <= Z1-alpha/2 sqrt(pq/n) - phat)
= P(phat - Z1-alpha/2sqrt(pq/n) <= p <= phat + Z1-alpha/2 sqrt(pq/n))
= P(phat - Z1-alpha/2sqrt(phat(1-phat)/n) <= p <= phat + Z1-alpha/2 sqrt(phat(1-phat)/n)),

where this last equality is approximate because in it we use the sample proportion phat to estimate p. Following the text, we let

pL = phat - Z1-alpha/2sqrt(phat(1-phat)/n)
pU = phat + Z1-alpha/2sqrt(phat(1-phat)/n)

The idea is to see that these two numbers satisfy the above characterizations ((6.1) and (6.2)). We proceed to do that. Under the assumption that X ~ B(n, pL), we have for x = n phat,

P(X > x) = 1 - P(X <= n phat) = 1 - P(Z <= (n phat - n pL)/sqrt(npL(1-pL)) =
1 - P(Z <= (nZ1-alpha/2 sqrt((phat(1-phat)/n))/sqrt(npL(1-pL))))
= 1 - P(Z <= Z1-alpha/2 sqrt((phat(1-phat))/(pL(1-pL)))) = 1 - (1-alpha/2) = alpha/2

because sqrt(phat(1-phat))/sqrt(pL(1-pL)) is approximately equal to 1 (goes to 1 as n goes to infinity).