Interface:Axioms of first-order logic as set forth in metamath problem 17

The axioms for first-order logic that we present here are intended to represent a relatively traditional axiomization of first-order logc in terms of free variables and substitution. The specific way of representing those concepts in JHilbert is the one given in problem 17 on the metamath site. To solve that problem, we need to start with these axioms and prove "any or all" of the metamath statements ax-4 through ax-17, which roughly are the statements at Interface:Axioms of first-order logic.

Formulas and objects
First we build on Interface:Classical propositional calculus.  param (CLASSICAL Interface:Classical_propositional_calculus ) 

We use φ, ψ, χ, and θ to represent formulas.  var (formula φ ψ χ θ) 

A term in conventional terminology corresponds to what metamath calls a class. Here we use the word object only because term is a JHilbert keyword.

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

A variable is what metamath calls a set. The parts of metamath we're concerned with here don't include actual set theory axioms (with the possible exception of those which are really equality axioms, only peripherally related to set theory), but calls the things being quantified over sets.

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

A variable can be used where an object is expected, although it needs to be converted via 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 an object is expected). In metamath, the equivalent conversion is, although metamath is slightly different from JHilbert in terms of how it must be used.  term (object (value variable)) 

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

Although the statement of problem 17 does not explicitly mention, since it is used in the definition of substitution (given next), we assume the problem intends for the usual metamath definitions to be applied.  term (formula (∃ variable formula)) stmt (df-ex  ((∃ x φ) ↔ (¬ (∀ x (¬ φ))))) 

Equality
The statement of the problem does not mention any equality axioms other than stdpc6 and stdpc7 discussed below. Therefore, we assume that those are intended to be sufficient.

As a matter of syntax, metamath defines equality of two classes, not just two set variables, so we do the same. However, stdpc6 and stdpc7 only give equality meaning with set variables, not more general classes (the parts of metamath which define class equality, in the set theory section, are not part of the statement of problem 17).

 term (formula (= object object)) 

Substitution
A number of the axioms are stated in terms of substitution. According to the statement of problem 17, we are supposed to use the following definition of substitution. As a matter of syntax, metamath defines the substitution of a class for a set variable, not just a set variable for a set variable, so we do the same. However, there isn't any theorem or axiom that gives substitution any meaning except when a variable is being substituted (the parts of metamath which define substitution of a class for a set, in the set theory section, are not part of the statement of problem 17).

 term (formula (subst object variable formula)) stmt (dfsb7  ((subst (value y) x φ) ↔ (∃ z (((value z) = (value y)) ∧ (∃ x (((value x) = (value z)) ∧ φ)))))) </jh>

Free variables
Metamath discusses free variables in the context of the formula, which can be read as "x is effectively not free in φ". Metamath does not give this concept a notation other than, so we do not either.

Axioms
The first axiom is the ability to specialize to another variable.  stmt (stdpc4  ((∀ x φ) → (subst (value y) x φ))) </jh>

The second axiom is a version of being able to add universal quantification to the consequent.  stmt (stdpc5 ((φ → (∀ x φ))) ((∀ x (φ → ψ)) → (φ → (∀ x ψ)))) </jh>

The third axiom is the ability to generalize a theorem.  stmt (ax-gen (φ) (∀ x φ)) </jh>

The last two axioms concern equality. The first equality axiom is reflexivity.  stmt (stdpc6  (∀ x ((value x) = (value x)))) </jh>

The other equality axiom is a version of being able to substitute equals for equals.  stmt (stdpc7  (((value x) = (value y)) → ((subst (value x) y φ) → φ))) </jh>

Distributing universal quantification across implication
Although it is not mentioned in the statement of metamath problem 17, it seems hard to build up formulas without an axiom such as the following. At least for now, we assume it here although it is not known whether it is independent from the remaining axioms.

 stmt (ForAllImplication  ((∀ x (φ → ψ)) → ((∀ x φ) → (∀ x ψ)))) </jh>

Distinct variables
None of the axioms presented so far make any reference to distinct variable constraints. Therefore, no theorems which rely on distinct variable contraints could be proved. This isn't really a problem from the point of view of proving metamath's  through , which is the main point of this exercise. The only one of the standard metamath axioms for first-order logic which involves distinct variables is, which corresponds pretty closely to   at Interface:Axioms of first-order logic in terms of substitution built on equality (given our use of   to represent   being effectively not free in  ).