information:extraction, information:filtering
Theology

Alhazen was a Muslim and most sources report that he was a Sunni and a follower of the Ash'ari school. Ziauddin Sardar says that some of the greatest Muslim scientists, such as Ibn al-Haytham and Abū Rayhān al-Bīrūnī, who were pioneers of the scientific method, were themselves followers of the Ashʿari school of Islamic theology. Like other Ashʿarites who believed that faith or taqlid should apply only to Islam and not to any ancient Hellenistic authorities, Ibn al-Haytham's view that taqlid should apply only to prophets of Islam and not to any other authorities formed the basis for much of his scientific skepticism and criticism against Ptolemy and other ancient authorities in his Doubts Concerning Ptolemy and Book of Optics.

Alhazen wrote a work on Islamic theology in which he discussed prophethood and developed a system of philosophical criteria to discern its false claimants in his time. He also wrote a treatise entitled Finding the Direction of Qibla by Calculation in which he discussed finding the Qibla, where prayers (salat) are directed towards, mathematically.

There are occasional references to theology or religious sentiment in his technical works, e.g.in Doubts Concerning Ptolemy:

Truth is sought for its own sake... Finding the truth is difficult, and the road to it is rough. For the truths are plunged in obscurity.... God, however, has not preserved the scientist from error and has not safeguarded science from shortcomings and faults. If this had been the case, scientists would not have disagreed upon any point of science...

In The Winding Motion:

From the statements made by the noble Shaykh, it is clear that he believes in Ptolemy's words in everything he says, without relying on a demonstration or calling on a proof, but by pure imitation (taqlid); that is how experts in the prophetic tradition have faith in Prophets, may the blessing of God be upon them. But it is not the way that mathematicians have faith in specialists in the demonstrative sciences.

Regarding the relation of objective truth and God:

I constantly sought knowledge and truth, and it became my belief that for gaining access to the effulgence and closeness to God, there is no better way than that of searching for truth and knowledge.