Sayyiduna Ali (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) that he (peace and blessings be upon him) said: "The pen has been lifted from three: the sleeper until he wakes up, the child until he reaches puberty, and the insane until he regains his reason."
And Imam al-Shafi'i (may Allah have mercy on him) took the hadith of Ibn Umar (may Allah be pleased with him) about being permitted to fight as evidence, and it has already passed.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15109