Solution (source code)

= Solution

Write $\mathbf r=\sum_i s_i\mathbf a_i$. The <electron density> is periodic with period one in each $s_i$, so its three-dimensional <Fourier series> has integer harmonics:
$$
\rho(\mathbf r)=\sum_{h,k,l\in\mathbb Z}\rho_{hkl}e^{2\pi i(hs_1+ks_2+ls_3)}
=\boxed{\sum_{\mathbf G}\rho_{\mathbf G}e^{i\mathbf G\cdot\mathbf r}.}
$$
If $\Omega$ is a <primitive unit cell> of volume $\Omega_c$, <Fourier orthogonality> gives
$$
\rho_{\mathbf G}=\frac1{\Omega_c}\int_\Omega\rho(\mathbf r)e^{-i\mathbf G\cdot\mathbf r}\,d^3r.
$$
Conversely, translation by $\mathbf a_i$ multiplies a general <plane wave> by $e^{i\mathbf q\cdot\mathbf a_i}$. Periodicity permits only $\mathbf q\cdot\mathbf a_i\in2\pi\mathbb Z$, precisely the <reciprocal lattice vectors>. For a physical bounded periodic <electron density>, the expansion exists in the usual square-integrable sense.