Answer
I say, and with God's success: It is not obligatory upon him; because reason is a condition for its obligation, and he is not among those addressed and accountable; as narrated by Ali, may God be pleased with him, that the Prophet, peace be upon him, said: "The pen is lifted from three: from the child until he reaches maturity, from the sleeper until he wakes up, and from the insane until he recovers." This is found in Sunan Abu Dawood 4: 140, Sunan al-Nasa'i al-Kubra 4: 324, Musnad al-Tayalisi 1: 15, and Musnad Abu Ya'la 1: 440. Refer to Maraqi al-Falah, p. 173, and God knows best.