No, it's not just a dream. It's a little bit complicated, but it makes way more sense after you read this, which is a brief of the book Roberta Sparrow wrote (which she didn't, actually). By the way I don't think it's just a comedy, it's a movie which makes you think about it, and that's the purpose.
http://ruinedeye.com/cd/liture.htm