Alhazen solved problems involving congruences using what is now called Wilson's theorem. In his Opuscula, Alhazen considers the solution of a system of congruences, and gives two general methods of solution. His first method, the canonical method, involved Wilson's theorem, while his second method involved a version of the Chinese remainder theorem.