The Theory of Electron Diffraction