Interface:Axioms of general set theory

First, we adopt the axioms of propositional logic and first-order logic (including equality):

 param (CLASSICAL Interface:Classical_propositional_calculus ) param (FIRSTORDER Interface:First-order_logic_with_quantifiability (CLASSICAL) ) 

First-order logic provides us with two kinds:  is a variable, which represents a set and can be quantified over, and   is an expression which represents a set. For example, a variable might be,  , or  , but an object could be the singleton  , the unordered pair  , the ordered pair  , the union  , etc. To some extent the concepts of variable and object correspond to set and class in some theories (like metamath's set.mm), but one key difference is that we have no proper classes thanks to the axiom of quantifiability.

 var (variable x y z w) var (formula φ) 

We define one key predicate. The formula  means "A is an element of B".

 term (formula (∈ object object)) 

Our first axiom, the axiom of extensionality, states that if two sets have the same elements, they are equal. In symbols this is. Versions with fewer distinct variable constaints also hold, but they can be proved from this version and other axioms, so we assume the weakest version (the one with the most distinct variable constraints).

 stmt (ExtensionalityVariable ((x y z)) ((∀ z (((value z) ∈ (value x)) ↔ ((value z) ∈ (value y)))) → ((value x) = (value y)))) 

The principle that equals can be substituted for equals in JHilbert must be adopted as an axiom for each non-logical predicate (in this case ∈), which we do now.

 var (object A B A0 A1 B0 B1) stmt (MembershipBuilderLL  ((B0 = B1) → ((A ∈ B0) ↔ (A ∈ B1)))) stmt (MembershipBuilderRR  ((A0 = A1) → ((A0 ∈ B) ↔ (A1 ∈ B)))) 

The axiom of separation is. Given a set  and a formula   this asserts the existence of a set   which contains the elements of   which satisfy. The distinct variable constraint between  and   is needed and is part of textbook statements of this axiom. Most of the other distinct variable constraints are implicit in the notation in many textbooks, and not all of them are necessary, but as with extensionality we include them.  stmt (Separation ((x y z) (φ y z)) (∃ y (∀ x (((value x) ∈ (value y)) ↔ (((value x) ∈ (value z)) ∧ φ))))) 

The third axiom, the axiom of adjunction, states that given two sets, we can form a set which contains all the elements of one of them, plus the second set as a single element. That is, given  and y, there exists a set. The axiom in symbols is. It is rarely stated in this form, but is related to results such as the union of two sets being a set, the axiom of pairing, and the singleton of a set being a set.  stmt (Adjunction ((x z w) (y z w)) (∃ w (∀ z (((value z) ∈ (value w)) ↔ (((value z) ∈ (value x)) ∨ ((value z) = (value y))))))) 

Not an element is just an abbreviation for negation and element-of.  def ((∉ A B) (¬ (A ∈ B))) 

Defining sets
What we have presented so far provides the ideas of set theory, but there is one important notational detail to attend to. The above axioms let us conclude that there is a set with no elements, or a set whose only element is a set, but they do not provide any way to introduce notation such as   or   for those concepts.

We want to define  (the set of all   for which   holds), of kind , but we need to tread carefully to avoid Russell's paradox and related problems. Metamath's set.mm uses the definition, which allows   to be a proper class rather than a set. As long as we assume the axiom of quantifiability, this avenue is not open to us. Instead, we provide a version of the metamath definition which has a hypothesis stating that the resulting set exists. This closely parallels the idiom of proving that something exists, and only then introducing a notation for it.

The syntax  is not available in JHilbert, so we will write it as.  term (object (abstract variable formula)) </jh>

Our restricted version of the metamath definition follows. The hypothesis is, which can be paraphrased as "  is a set". We adopt an axiom that this hypothesis lets us conclude. All variables are distinct except that  can (and typically does) appear in.  var (variable result) stmt (Abstraction ((result x φ) (result x y)) ((∃ result (∀ x (((value x) ∈ (value result)) ↔ (subst (value x) y φ)))))  (((value x) ∈ (abstract y φ)) ↔ (subst (value x) y φ))) </jh>