Theory of diffusion in periodic systems: the diffusion coefficient