In applied literature about the required sample size such as "Sampling for effective internal auditing" we find formulas for the required sample size to detect a proportion of a feature or an error rate as (I cite and use the same variable names) $$ n = \frac{C^2 \rho q}{P^2}, $$ where $n$ is the required sample size, $C$ is the confidence level, $P$ is some measure of precision, $\rho = 1-q$ is the expected error rate.
Where do these formulas from auditing come from? I understand that their origin must be some Binomial distribution consideration with normal approximation.
Is there a publication where these sample size requirements are derived in a rigorous mathematical way? I find quite a few publications citing formulae as the above but what is a good source for at the same time a rigorous mathematical treatment and applications in audit?