It is related from ʿUmar ibn al-Khattāb—may God be pleased with him—that he said:
"When you seek recreation, busy yourselves with archery; and when you converse, converse about the laws of inheritance."
The arithmetic of inheritance is a rational discipline founded upon a revealed basis: it trains the intellect while safeguarding the Sacred Law. Yet it is not a science pursued for its own sake, nor does the soul find perfection in it.
Those idolaters, for their part, worshipped the planets. They built temples for them and addressed them with a variety of supplications, as is well known from their histories and from the books composed in their vein—works steeped in polytheism and sorcery, in the invocation of the planets, and in incantations and oaths through which Iblīs and his legions are magnified. Because of these practices of magic and idolatry, Satan beguiled them with certain phenomena that drew them ever further into such shirk and sorcery. They therefore kept watch on the planets to determine their sizes, the measures of their motions, and the aspects among them, so that they might employ that knowledge for what they thought suited each planet.
Now, because the celestial spheres are circular, and their calculations cannot be known without geometry and the rules governing curved and straight lines, they delved into geometry for that purpose as well as for worldly construction. Thus they expanded these studies; had their only goal been the mere conceptualization of numbers and magnitudes, that aim alone would not have warranted the strenuous effort they expended.
Indeed, such conceptualization may be the ultimate goal for some people who simply enjoy it—for the soul’s delights come in many forms. Some find pleasure in chess, backgammon, and gambling, to the point that these games distract them from what would benefit them more.
It was from geometry, then, that the first formulation of logic emerged. They cast it into figures analogous to geometric figures and called its premises “boundaries,” just as those figures have boundaries, so that they might progress from the tangible form to the intelligible one. They resorted to this because their intellects were weak and knowledge could be attained by them only through such circuitous paths.