Ibrahim (may Allah have mercy on him) said that if a person of unsound mind gives divorce while in a state of sanity, his divorce will take effect.