I read this in Descartes' "Meditations on First Philosophy";
Next I examined attentively what I was. I saw that while I could pretend that I had no body and that there was no world and no place for me to be in, I could not for all that pretend that I did not exist. I saw on the contrary that from the mere fact that I thought of doubting the truth of other things, it followed quite evidently and certainly that I existed; whereas if I had merely ceased thinking, even if everything else I had ever imagined had been true, I should have no reason to believe that I existed. From this I knew that I was a substance whose whole nature is simply to think, and which does not require any place or depend on any material thing, in order to exist. Accordingly this I-that is, the soul by which I am what I am-is entirely distinct from the body, and indeed is easier to know than the body, and would not fail to be whatever it is even if the body did not exist.
In the end Descartes 'resolves' the whole problem of the mind-matter interaction by an act, it might be thought, of intellectual bad-faith; by saying that it is a mystery, only understandable to God.
Picture, if you will, the following images. There is a bewigged philosopher in a pensive mood. A bubble appears from his mind with a question mark. “Ah”, says the sage, “I think therefore I am.” The said philosopher continues in his pensive mood. Another bubble appears. This time nothing comes. A look of panic appears on the thinker’s face. The bubble only contains an exclamation mark. And then-POOF!-the thinker vanishes from the scene, wig and all! :))