I was solving some exercises in complex analysis in preparation for a qualifying exam, and I came across a problem which asked me to prove that if $x, y \in \mathbb{R}$ then
$ e^{ix} = e^{iy} \iff x - y = 2 \pi n \quad \text{for some} \ n \in \mathbb{Z} $
At first I thought it was quite easy and what I thought is that it was kind of obvious if I used Euler's formula and equated real parts and imaginary parts, so that
$ e^{ix} = e^{iy} \iff \cos{x} = \cos{y} \quad \text{and} \quad \sin{x} = \sin{y} $
and thought of this in terms of the corresponding points in the unit circle. But that doesn't seem very rigorous to me. So I would like to ask the following.
How can this be proved using another definition for the trigonometric functions like the series definition or the definition as solutions of the differential equation y'' = -y with some initial conditions? And what properties of the trigonometric functions have to be used to prove this?
Note I thought of doing the following but still can't complete the argument.
$ e^{ix} = e^{iy} \iff e^{i(x-y)} = 1 \iff \cos{(x-y)} = 1 \quad \text{and} \quad \sin{(x-y)} = 0 $
and now I would like to conclude that this happens if and only if $x-y = 2 \pi n$ but don't know how to justify this.
Any help would be very appreciated. Thank you.