Now that Descartes has found a piece of certain knowledge—that he exists as a thinking thing—he starts to look around for more of these self- evident truths. He discovers that he has quite a few of them, prominent among these being the truths of mathematics and logic, and he is optimistic about his chances for developing a system of certain knowledge. Then he realizes a kink in his plan. These clear and distinct perceptions are only indubitable so long as he is attending to them. As soon as they fall out of awareness, the doubt can creep back in. Once again, he can begin to wonder whether it was an evil demon who caused him to believe in the certainty of these truths. Suddenly, things do not look too rosy for his system of certain knowledge; if he needs to keep every truth perpetually before his mind, then he cannot expect too make much headway in unraveling the facts of nature.
Descartes' solution is to bring God into the picture. By proving that God is the cause of our clear and distinct perception, and that, further, God is perfect in every way and thus no deceiver, he will be able to secure lasting certainty for clear and distinct perceptions. He, therefore, sets out to prove that God exists.
Descartes gives at least two arguments for God's existence. The first one, found in I.14, is a version of the ontological argument for God's existence. Descartes' ontological argument goes as follows: (1) Our idea of God is of a perfect being, (2) it is more perfect to exist than not to exist, (3) therefore, God must exist.
The second argument that Descartes gives for this conclusion is far more complex. This argument rests on the distinction between two sorts of reality. Formal reality is the reality that anything has in virtue of existing. It is just regular, garden-variety reality. Formal reality comes in three grades: infinite, finite, and mode. God is the only existing thing with infinite formal reality. Substances all have finite formal reality. Finally, modes have modal formal reality. An idea, insofar as it is considered as an occurent piece of thought, has modal formal reality (since any particular thought, as we will see later, is just a mode of mind).
Ideas, however, also have another kind of reality, unique to them. When considered in their relation to the objects they represent, ideas can be said to have objective reality. There are three grades of objective reality, precisely mirroring the three grades of formal reality. The amount of objective reality contained in an idea is determined solely on the basis of the amount of formal reality contained in the object represented by the idea.
Descartes begins the argument by making the controversial claim that we all have an idea of God as an infinite being. (He believes that we cannot fail to have this idea because he thinks it is innate.) Because our idea of God is of an infinite being, it must have infinite objective reality. Next, Descartes appeals to an innate logical principle: something cannot come from nothing. Reasoning from this principle he arrives at two other causal principles: (1) There must be as much reality in a cause as in an effect, and so, (2) there must be as much formal reality in a cause of an idea as there is objective reality in an idea. Since we have an idea with infinite objective reality (namely, the idea of God), Descartes is able to conclude that there is a being with infinite formal reality who caused this idea. In other words, God exists.