Locke say that there cannot be pain in a dream so that’s how you prove that you’re awake or sleep. Flanagan had a few questions about dreaming, one was “how can I be sure I am not always dreaming?” “Can I be immoral in my dreams?” “Are dreams conscious experiences that occur during sleep?” and lastly “does dreaming have an evolutionary function?” (iep.utm.edu)
According to Owen Flanagan’s book The Science of the Mind and he presents Descartes’ Modal Argument as follows:
“1. I cannot possibly doubt that I exist as a thinking thing. (This was established as we tried to doubt our existence and found ourselves, therefore, affirming it.)” (Flanagan/WordPress)
“2. I can doubt, however, that I have a body, and thus that I exist as a physical thing. “ (Flanagan/WordPress)
“3. Therefore, thinking is essential to what I am. My body is not. Furthermore, I know my mind more easily than I know my body. “From this I knew that I was a substance the whole essence or nature of which is to think, and that for its existence there is no need of any place, nor does it depend on any material thing so that this ‘me,’ that is to say, the soul by which I am what I am, is entirely distinct from body, and is even more easy to know than the latter; and even if body were not, the soul would not cease to be what it is.”