Gödel's ontological proof uses modal logic
Outline
The proof uses modal logic, which distinguishes between necessary truths and contingent truths. In the most common semantics for modal logic, many "possible worlds" are considered. A truth is necessary if it is true in all possible worlds. By contrast, if a statement happens to be true in our world, but is false in another world, then it is a contingent truth. A statement that is true in some world (not necessarily our own) is called a possible truth.
Furthermore, the proof uses higher-order (modal) logic because the definition of God employs an explicit quantification over properties.First, Gödel axiomatizes the notion of a "positive property": for each property φ, either φ or its negation ¬φ must be positive, but not both (axiom 2). If a positive property φ implies a property ψ in each possible world, then ψ is positive, too (axiom 1). Gödel then argues that each positive property is "possibly exemplified", i.e. applies at least to some object in some world (theorem 1). Defining an object to be Godlike if it has all positive properties (definition 1), and requiring that property to be positive itself (axiom 3), Gödel shows that in some possible world a Godlike object exists (theorem 2), called "God" in the following. Gödel proceeds to prove that a Godlike object exists in every possible world.
To this end, he defines essences: if x is an object in some world, then a property φ is said to be an essence of x if φ(x) is true in that world and if φ necessarily entails all other properties that x has in that world (definition 2). Requiring positive properties being positive in every possible world (axiom 4), Gödel can show that Godlikeness is an essence of a Godlike object (theorem 3). Now, x is said to exist necessarily if, for every essence φ of x, there is an element y with property φ in every possible world (definition 3). Axiom 5 requires necessary existence to be a positive property.
Hence, it must follow from Godlikeness. Moreover, Godlikeness is an essence of God, since it entails all positive properties, and any non-positive property is the negation of some positive property, so God cannot have any non-positive properties. Since necessary existence is also a positive property (axiom 5), it must be a property of every Godlike object, as every Godlike object has all the positive properties (definition 1). Since any Godlike object is necessarily existent, it follows that any Godlike object in one world is a Godlike object in all worlds, by the definition of necessary existence. Given the existence of a Godlike object in one world, proven above, we may conclude that there is a Godlike object in every possible world, as required (theorem 4). Besides axiom 1-5 and definition 1-3, a few other axioms from modal logic were tacitly used in the proof.
From these hypotheses, it is also possible to prove that there is only one God in each world by Leibniz's law, the identity of indiscernibles: two or more objects are identical (the same) if they have all their properties in common, and so, there would only be one object in each world that possesses property G. Gödel did not attempt to do so however, as he purposely limited his proof to the issue of existence, rather than uniqueness.