Rigorous validity of the Boltzmann equation for a thin layer of a rarefied gas