The Theory of the Three-Crystal Electron Interferometer