Interface:Axioms of first-order logic

The axioms of first-order logic are usually stated in terms of substitution of one variable or constant for another, free variables and bound variables. JHilbert or metamath do not have the ability to perform this kind of substitution or recognize free variables syntactically, so the version of the axioms here is not based on those concepts. JHilbert does have distinct variable constraints, although whether to use them in this context is somewhat a matter of taste; the metamath archive contains versions of many of these axioms either with distinct variable constraints or with other conditions which also make them correct. The axioms as presented here are adapted from metamath (which in turn got many of the ideas from a 1965 paper by Tarski).

Formulas and objects
We build on Interface:Classical propositional calculus:  param (CLASSICAL Interface:Classical_propositional_calculus ) 

By convention we use φ, ψ, χ, and θ to represent formulas:  var (formula φ ψ χ θ) 

A variable is something we can quantify over.

 kind (variable) var (variable x y z x0 x1 y0 y1) 

We also define terms, although for our current purposes the only kind of term we consider is a variable. Theories built on first-order logic, like ZFC set theory or Peano arithmetic, will define additional kinds of terms such as  (addition) or   (union). Because  is a JHilbert keyword, we use the word object to refer to a term.

 kind (object) var (object s t u s0 s1 t0 t1) 

To use a variable as a term in JHilbert needs the following explicit conversion. When we are writing informally (rather than in JHilbert proofs themselves), we may omit the conversion (it should be understood whereever we use a variable in a context where a term is expected).  term (object (value variable)) 

Using a term where a variable is expected (for example the  in  ) is of course not allowed.

Quantification
We extend the available formulas with universal quantification:  term (formula (∀ variable formula))

stmt (QuantifiedImplication  ( (∀ x (φ → ψ)) → ((∀ x φ) → (∀ x ψ)) ) ) stmt (QuantifiedNegation  ( (¬ (∀ x φ)) → (∀ x (¬ (∀ x φ))) ) ) stmt (QuantifierCommutation  ( (∀ x (∀ y φ)) → (∀ y (∀ x φ)) ) ) 

Generalization:  stmt (Generalization ((x φ)) (φ → (∀ x φ))) stmt (generalize (φ) (∀ x φ)) 

Although a usable theory of predicate logic will generally have at least one more quantifier (∃ for "there exists"), it can be defined in terms of ∀, so we have avoided it in the above axioms and do not need to define it here.

Equality
In this set of axioms we are concerned with equality between two variables, rather than two terms. Interface:Axiom of quantifiability takes up equality of terms in one way, and Interface:Equality of classes has a different approach. However, as a matter of syntax we do say that equality is between two terms, so that those interfaces can adopt an axiom concerning equality between terms without having to use two different equality symbols, one for variables and one for terms.

 term (formula (= object object)) 

Building equalities
One of the equality axioms in most formulations of predicate logic with equality is some variation of. This can be thought of as a funny way to write transitivity, or as a slight variation of.  stmt (EqualityAxiom   (((value x) = (value y)) → (((value x) = (value z)) → ((value y) = (value z))))) </jh>

Axioms combining equality and quantification
The  axiom asserts that there is at least one object:  stmt (Existence  (¬ (∀ x (¬ ((value x) = (value y))))) ) stmt (QuantifierSubstitution  ((∀ x ((value x) = (value y))) → (∀ y ((value y) = (value x)))) ) </jh>

The  axiom converts a statement about one variable to a statement about another. In most uses,  will contain   as a free variable. Then the axiom allows one to deduce, a statement where   is not free, but where   is free. means (in some sense),  with   substituted for. Metamath contains several equivalent variations of this axiom; we pick ax11v, which is the most convenient one for us.  stmt (VariableSubstitution ((x y))   (((value x) = (value y)) → (φ → (∀ x (((value x) = (value y)) → φ)))) ) </jh>

There is also the principle of "equals can be substituted for equals". In our system, there is no way to express this generally, and it must be provided separately for each kind of predicate or operation which exists in the theory (for example,  (is an element of), for set theory, or   (successor) or   (addition) for Peano arithmetic). Such a statement for equals itself,, can be proved from the above axioms, so an additional axiom is not needed here.

Axiom of quantifiability
In the axioms as shown above, we do not preclude the possibility of a term which cannot be equal to any variable (this will be true of proper classes in some formulations of set theory, for example). If this generality is not needed, assuming the Interface:Axiom of quantifiability may make life easier.