Question: Is God free to inflict pain on infants in the next life?
Answer: God is free to do that, and in doing it He would be just. Likewise, whenever He inflicts an infinite punishment for a finite sin, and subordinates some living beings to others, God is gracious to some and not to others, and creates men knowing well that they will disbelieve — all that is justice on His part. And it would not be evil on the part of God to create them in the painful punishment and to make it perpetual. Nor would it be evil on His part to punish the believers and to introduce the unbelievers into the Gardens. Our only reason for saying that He will not do that is that He has informed us that He will punish the unbelievers — and He cannot lie when He gives information.
— from “Kitab al-Luma”
Abū al-Hasan Alī ibn Ismā’īl al-Ash’ari (874–936) was an Arab Muslim theologian and the founder of the Ash-ari school of Islamic philosophy and theology. Born in Basra, Iraq, al-Ash’ari spent most of his life in Baghdad where he wrote more than 100 works, of which only 4 have survived. A proponent of an atomistic account of reality, al-Ash’ari was influenced by Greek and Hindu thinkers and held the view that God created every moment in time and every particle of matter, rendering cause and effect null and void. At the same time, he held a qualified belief in free will.