The BBC has reported on a study at the University of California San Diego which shows that it's easier for people to solve problems after they've had REM sleep. The article also refers to some famous discoveries that were allegedly made in dreams. The study seems to verify the Reverse Learning Theory of Dreams which says that during REM sleep, some of the useless memories and connections in our brains are destroyed. This gives our brains room to make more connections, and therefore develop new ideas.