Confidence intervals from pivotal quantities I am reading a book somewhere it introduces pivot as a way of constructing a confidence interval for a parameter.
My question is:
it says $q_{0.025} < = \lambda n \bar{X} <= q_{0.975} $ is a 95% confidence interval of $\lambda n \bar{X}$ where $q_{0.025}$ is the 2.5% quantile of a gamma distribution and $q_{0.975}$ is the 97.5% quantile of a gamma distribution. 
Then it says to find the confidence interval of $\lambda$, it just divides the above inequality by $n\bar{x}$ to get $\frac{q_{0.025}}{n\bar{X}} < = \lambda <= \frac{q_{0.975}}{n\bar{X}}$ as a 95% confidence interval of $\lambda$.
My question is, what is the justification of saying the above is a 95% confidence interval of $\lambda$?  
Is it true that as long as we do the same manipulation (i.e. apply a function to every term on each of the 3 terms in the inequality), then we will arrive at a 95% confidence interval for the middle term?
i.e. say I do the following:
$\cos(q_{0.025})<= \cos(\lambda n \bar{X})<= \cos(q_{0.975})$    , 
then this will become the 95% confidence interval of $\cos(\lambda n \bar{X})$ ?  
and if I do the following:
2.5 + $\cos(q_{0.025})<= 2.5 + \cos(\lambda n \bar{X})<= 2.5+ \cos(q_{0.975})$  , then this is a 95% confidence interval of $2.5 + \cos(\lambda n \bar{X})$?
and if I do this:
$\sqrt{q_{0.025}} <= \sqrt{\lambda n \bar{X}} < = \sqrt{q_{0.975}}$, then $(\sqrt{q_{0.025}}, \sqrt{q_{0.975}})$ will be the 95% confidence interval of $\sqrt{\lambda n \bar{X}}$ ?
 A: The question boils down to the purely mathematical consideration -- "when are inequalities preserved?".
If you make changes that preserve ordering, then inequalities will be preserved.
Consider a simple probability statement like $P(a\leq X\leq b)=c$ and a monotonic-increasing (i.e. order-preservng) transformation, $g()$. Then $P(g(a)\leq g(X)\leq g(b))=c$. (With a monotonic decreasing function the probability is preserved but the direction of the inequalities would flip.) 
$\qquad$
But if $g$ were not monotonic, such a statement would not be true in general. e.g. consider $g(x)=(x-m)^2$, where $m=\frac{a+b}{2}$ and $X$ continuous, then $P(g(a)\leq g(X)\leq g(b))=0$.
So you can't take a function like $\cos$ and hope that in general the interval with transformed limits will preserve the coverage in the original probability statement. If the random variable on an interval is such that $\cos$ is monotonic increasing over that interval, then the probability statement would be preserved.
Note that if $\bar{X}$ is positive then you can divide through by it while leaving the inequality unaltered, since dividing all terms by a positive constant preserves ordering. (This could be relaxed to almost surely while preserving the probability statement.)
