Ibrahim (may Allah have mercy on him) said: When a mentally deficient person divorces in a state of lucidity, his divorce takes effect.