Descartes seeks to prove that God exists and to do so without reference to the external world. The first approach is through conceivability, and in the Third Meditation Descartes examines the ideas he has in his mind as "modes of thought" that are similar in the sense that they exist in his mind but are different form one another in that some contain more "objective reality" than others. Certain ideas might have been produced by experience, and these include such ideas as colors, touch, measurement, and other objective elements which could be discerned through the senses. The idea of God also exists within the mind, and this idea must have derived from a cause. Descartes asks if he could have been the cause of this idea, as he is the cause of the idea of color or other sensations. To answer this, he considers what it is that he means by God and states that he means a substance which is infinite, independent, omniscient, and omnipotent. Descartes examined these qualities and found that the idea of God could not have originated within himself, deciding that while he could conceive of substance because he was himself substance, he could not conceive of infinite substance except as infinite substance placed that idea into his mind.
Descartes argues from a mathematical point of view concerning quantity or quantification and finds that the most certain truths are those which are recognized in connection with mathematics. He then asks if it is not so that the mere fact that he can produce from his thought the idea of something entailing everything that he clearly and distinctly perceives to belong to that thing does not mean that the thing really does belong to it, and he says that this proves the existence of God because the idea of God is within him just as is the idea of shape or number. He states that he can regard the existence of God with at least the same level of certainty as he attributes to the truths of mathematics.
...