The theorem is that if a function f is periodic with frequency w (period a), the function can be expanded as Fourier polynomials. i.e.
If f(x+na)=f(x)
Then f(x)=\sum_{k=nK}f(k)e^{-ikx}
where K=\frac{2\pi}{a}
The proof actually relies on common sense.
define:
f(k)=\int f(x)e^{-ikx}dx
One can see that both f(x) and exp(-ikx) are perodic, where average of exp(-ikx) is zero. So if the two periods are not commensurate, f(k) will be zero.
The only possible nozero f(k) occurs when kx=2npi, where k=nK.