Some Mathematical Aspects of the Grating Theory