What is the flaw in proving $i=0$ from $\ln(1)=0$? Today, I was playing with numbers and I found this:
$$\begin{align}
\ln(1) = 0
\Rightarrow \ln((-1)^2) = 0
\Rightarrow 2\ln(-1) = 0
\Rightarrow 2\pi i = 0
\Rightarrow \boxed{i = 0}
\end{align}$$
Apart from this I found another proof:
$$\begin{align}
\ln(1) = 0
\Rightarrow \ln(e^{2\pi i}) = 0
\Rightarrow 2\pi i = 0
\Rightarrow \boxed{i = 0}
\end{align}$$
This obviously is not true and I myself don't know what's the flaw in this proof. Any help/hint is appreciated
Edit : My guess is that I am treating $i$ as a variable rather $i = \sqrt{-1}$. Is this logic correct?
Thanks
 A: The rule $\log(a^x)=x\log a$ only applies when $a>0$, so even if we stay in the context of the real numbers, the first argument is flawed.
We can extend the definition of exponentiation to the complex numbers by defining $e^z$ as its Taylor series. By Euler's formula, $e^{z+2k\pi i}=e^z$ for all $k\in\Bbb{Z}$ . Hence, the function $e^z$ is periodic and so is not invertible. This makes defining $\log$ tricky. There are number of different approaches; for example, we could "restrict the domain of $e^z$", i.e.  define $\log$ as the inverse of the function $f:\{z:-\pi<\Im(z)\le\pi\}\mapsto\Bbb{C}$ given by $f(z)=e^z$. If $\log$ is defined this way, then $\log(e^z)=z$ is only true when $-\pi<\Im(z)\le\pi$. This is analogous to how, in the real numbers, $\arcsin(\sin (x))=x$ is only true when $-\pi/2\le x\le\pi/2$.
A: The exponential function $z\mapsto e^z$ is well-defined on the whole complex plane. But it is not 1-1, because for any $z$, the values $e^z,e^{z+2\pi i},e^{z+4\pi i}$ etc are all equal.
So it can't have a well-defined inverse on its range (which in this case is the non-zero complex numbers). But by specifying which of the multiple candidate values to choose, we can define a partial inverse (and call it $\ln$), but it will necessarily have discontinuities; and it will not satisfy $\ln ab = \ln a + \ln b$ for all non-zero complex numbers $a,b$. All you can say for sure is that $\ln ab = \ln a + \ln b +{}$some integral multipe of $2\pi i$.
So your reasoning breaks down where you claim that $\ln((-1)^2)=2\ln(-1)$.
A: The problem is that as much as you cannot deal with $\sqrt{-1}$ the same way you do with a real number you cannot understand $\ln(x)$ and $\ln(z)$, $x$ real, $z$ complex to be the same function. When you want to do such thing you always have to extend the function to a higher domain and then look how it behaves.
So for $x$ and $y$ real and positive:
$$\ln(e^{x+iy})=x + i(2\pi \left \lfloor \frac1{2}-\frac{y}{2\pi} \right \rfloor+y)$$
Then for $x=0$ $y=2\pi$ you have
$$\ln(e^{2\pi iy})= i(2\pi \left \lfloor \frac1{2}-\frac{2\pi}{2\pi} \right \rfloor+2\pi)= i(-2\pi +2\pi) = i \cdot 0 = 0$$
Therefore, it is not $i=0$, but $i \cdot 0 = 0$ which is totally ok.
