Proof that $\pi =\lim_{n\to\infty}\frac{2^{4n}n!^4}{n(2n)!^2}$ In this post, the symbol $\sim$ means asymptotically equivalent.
The relationship between $\pi$ and factorials hinges on Stirling's formula:
$$n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n\implies n!^2\sim 2\pi n\left(\frac{n}{e}\right)^{2n}.$$
In a similar manner,
$$(2n)!\sim \sqrt{4\pi n}\left(\frac{2n}{e}\right)^{2n}.$$
Then, by taking the ratio of the two quantities and simplifying one gets
$$\frac{(2n)!}{n!^2}\sim \frac{2^{2n}}{\sqrt{\pi n}}.$$
By squaring both sides and further manipulation:
$$\pi =\lim_{n\to\infty}\frac{2^{4n}n!^4}{n(2n)!^2}.$$
Also, note that the last limit for $\pi$ above and
$$\frac{n!^2}{2n}\left(\frac{e}{n}\right)^{2n}$$
(which can be obtained as a limit for $\pi$ from Stirling's formula dircetly) have a different rate of convergence.
My question is, how can one justify the manipulations (e.g. squaring both sides) when the expressions are not equivalent but only asymptotically equivalent? When I used this I ran into problems:
$$\ln n!\sim n\ln n-n\, \text{(true)},$$
$$n!\sim e^{n\ln n-n}\, \text{(false)}.$$
 A: You are right that not all operations with asymptotically equivalent expressions are correct. For example, $f\sim g$ doesn't necessarily imply $e^f\sim e^g$. However, $f\sim g$ implies $f^k\sim g^k$ where $k$ is an integer. This follows directly from properties of limits:
$$\lim_{x\to a}\frac{f(x)^k}{g(x)^k}=\left(\lim_{x\to a}\frac{f(x)}{g(x)}\right)^k=1^k=1 $$
(This can be generalized to $k\in\mathbb{R}$ provided $f(x)^k$ is defined). Since the only thing we're doing here is squaring, i.e. $k=2$, your manipulations are justified.
A: You can avoid the $\sim$ by writing the Stirling formula in the form
$$n!=\sqrt{2\pi n}\left({n\over e}\right)^n\>g(n)\quad(n\geq1),\qquad \lim_{n\to\infty}g(n)=1\ ,$$
and similarly in the other equations, maybe with new $g$s.
A: The asymptotic equality $e^{f(n)} \sim e^{g(n)}$ means 
$$
\frac{{e^{f(n)} }}{{e^{g(n)} }}\to 1 \Leftrightarrow  e^{f(n) - g(n)}  \to 1 \Leftrightarrow f(n) - g(n) \to 0.
$$
But $f(n) \sim g(n)$ does not necessarily imply that the difference of the two sides tend to $0$ (or even that it is bounded). Thus $f(n) \sim g(n) \not\Rightarrow  e^{f(n)} \sim e^{g(n)}$. If, for example, $g(n)$ is evetually non-zero, then the reverse implication is true.
In your example
$$
\log n! - (n\log n - n) = \frac{1}{2}\log (2\pi n) + \mathcal{O}\!\left( {\frac{1}{n}} \right)
$$
which is not bounded.
