$e^{i\pi}$ paradox - invalid proof that $-4 \pi ^2=0$ This paradox is directly ripped off of this video 
by the youtube channel "Mathologer 2". There, he presents a paradox with the following steps:
$$e^{i \pi}=-1$$
$$(e^{i \pi})^2=(-1)^2$$
$$(e^{i \pi})^2=1$$
$$e^{2i \pi}=1 $$
$$e^{2i \pi +1}=e$$
$$\text{Substitute $e$ for $e^{2i \pi +1}$}$$
$$(e^{2i \pi +1})^{2i \pi +1}=e$$
$$e^{(2i \pi +1)^2}=e$$
$$e^{-4 \pi ^2+4 \pi i+1}=e$$
$$e^{-4 \pi ^2}e^{4 \pi i}e=e$$
$$e^{-4 \pi ^2}e^{4 \pi i}=1$$
$$\text{Substitute $e^{4 \pi i}$ for 1}$$
$$e^{-4 \pi ^2}=1$$
$$\ln(e^{-4 \pi ^2})=\ln(1)$$
$$-4 \pi ^2=0$$
I tried to extract some reasoning from the youtube comments, however they all conficted with each other; the error seems to come from one of these reasons:


*

*$(a^b)^c = a^{bc}$ is only true for real bases and exponents (in refernce to $(e^{2i \pi +1})^{2i \pi +1}=e^{(2i \pi +1)^2}$)

*This paradox is similar to the false assumption that $\sin(0)=\sin(\pi) \implies 0=\pi$ which is incorrect here as $\sin(x)$ is not bejective and the same goes for $e^{i\theta}$ since it is equal to $\cos(\theta)+i\sin(\theta)$

*Here the "$\pi$" represents radians, not the actual constant "$\pi$", similar to how 360 always has a degree sign always following it, so $2\pi$ can equal $0$ just like $360^{\circ}=0^{\circ}$


Reasons 1 and 2 both seem correct to me, but I don't understand why the power rule suddenly stops being correct for complex numbers (I seem to remember that $(ab)^z \neq a^zb^z$ when the exponent is imaginary as well). Which of these reasons are actually valid/invalid, and why?
 A: Imaginary exponentiation simply does not satisfy the rule $(a^b)^c=a^{bc}$. That's just the way it is. It is nice that many rules for real numbers also hold for complex numbers, but it is not an axiom. The rule holds for natural numbers, and it extends first to rationals (by algebraic considerations) and to real numbers (by the density of the rationals). But imaginary exponentiation is not defined in terms of real exponentiation, so there is no reason a priori for the equality to hold; and it doesn't, in general.
The second argument is irrelevant for the "paradox". The reasoning in your question derails with the "equality" $(e^{2 i\pi +1})^{2i\pi +1}=e^{(2i\pi+1)^2}$. Everything afterwards is false, in particular $e^{-4\pi^2}=1$. So the application of the logarithm is not the issue here. That said, the complex logarithm is multi-valued and not injective.
The third argument is also irrelevant, because it tries to "explain" the equality $\pi=0$. And there is no such equality here, since it appeared after invalid steps.

Edit: a bit more on exponentiation. Note that exponentiation already has issues with real numbers; for instance, one cannot define things like $(-1)^{1/2}$. Thus the equality $(a^b)^c=a^{bc}$ already fails for certain combinations of reals numbers: $(-1)^1=(-1)^{1/2\times2}$ but $(-1)^{1/2}$ makes no sense. In summary, exponentiation, even for real numbers, works nice with real exponents only when the base is positive: in that case, $a^b=e^{b\log a}$ is well-defined.
For complex numbers, $a^b$ still makes perfect sense when $a>0$ and $b$ is any complex number: if $b=u+iv$, we define $a^{u+iv}=a^u\,e^{iv\log a}$. For non-positive or even non-real $z$, only $z^n$, with $n\in\mathbb Z$, makes sense.
Finally, let us take a quick look at $(a^b)^c=a^{bc}$. This would come from
$$
(a^b)^c=e^{c\log a^b}=e^{cb\log a}=a^{bc}.
$$
So the issue appears to be with the equality $\log a^b=b\log a$. When $a$ is not a positive real number, the logarithm is multi-valued. Here is an example of the issue: we have $1^i=1$ (no issue here, this is well-defined). But $1=e^{2\pi i}$, so we want
$$
(1^i)^i=(e^{2\pi i})^i=e^{i\,\log e^{2\pi i}}.
$$
But now, using the "usual" properties of the logarithm, one is tempted to write $\log e^{2\pi i}=2\pi i$; but this is the weird (and wrong) equality $\log 1=2\pi i$. This amounts to redefine the logarithm so that it is not real on the reals. It can be done, but then we don't have $1^i=1$ anymore.
A: The key step is that the complex exponentiation is defined by $z^w:=e^{w\ln z}$ where $z,w\in\Bbb C$ and the logarithm is the principal value of the complex logarithm. Then
$$(e^{2\pi i+1})^{2\pi i+1}=\exp((2\pi i+1)\ln e^{2\pi i+1})=\exp((2\pi i+1)\ln e)=e^{2\pi i+1}\tag1$$
because the principal value means that we choose the argument of $\ln e^{i\theta}$ such that $\theta\bmod(-\pi,\pi]$, then in this case we have that $2\pi \bmod (-\pi,\pi]=0$.

ACTUALIZATION:
Other branches of the logarithm are generally defined as follows
$$\log_\alpha:\Bbb C\setminus\{0\}\to \Bbb R+i(\alpha,\alpha+2\pi],\quad z\mapsto \ln|z|+i\arg_\alpha(z)\tag2$$
where $\arg_\alpha(z)$ is a chosen argument of $z$ such that $\arg_\alpha(z)\in(\alpha,\alpha+2\pi]$. Then if $0\notin(\alpha,\alpha+2\pi]$ this mean that $\log_\alpha z\notin\Bbb R$ for any $z\in\Bbb C\setminus\{0\}$, thus we can't use these branchs to define complex powers as $z^w:=e^{w\log_\alpha z}$ because we will had that $e=e^1=e^{1\log_\alpha e}=e^z$ for some $z\in\Bbb C\setminus\{0\}$, what doesnt make sense because $e^z\notin\Bbb R$ but $e\in\Bbb R$.
If $0\in(\alpha,\alpha+2\pi]$ then the definition of complex powers as $z^w:=e^{w\log_\alpha z}$ makes sense and $(1)$ holds.
