Intuitionistic first-order logic

We start with propositional logic and our axioms.

 import (PROPOSITIONAL Interface:Intuitionistic_propositional_logic ) import (AXIOMS Interface:Axioms_of_intuitionistic_first-order_logic (PROPOSITIONAL) ) 

As usual, φ and ψ are formulas, x, y, and z are variables, and s, t, and u are terms:

 var (formula φ ψ φx φy φs ψy antecedent) var (object s t u s0 s1 t0 t1) var (variable x y z x0 x1 y0 y1) 

We largely follow the development from First-order logic in terms of substitution built on equality although some of the details are different and of course we don't prove quite all the theorems, as not all of them hold in intuitionistic logic.

Substitution
As with First-order logic in terms of substitution built on equality (slightly more so, even), substitution is central to our proofs, so we start with some substitution theorems.

Rule forms of substitution axioms
Here are some rules which are convenience forms of axioms, just as in First-order logic in terms of substitution built on equality.  thm (specializeToObject ((H (∀ x φ))) (subst s x φ) ( H       x φ s SpecializationToObject applyModusPonens ))

thm (specializeToObjectInConsequent ((H (antecedent → (∀ x φ)))) (antecedent → (subst s x φ)) ( H       x φ s SpecializationToObject applySyllogism ))

thm (makeSubstExplicit ((x s) (x ψ)) ((H (((value x) = s) → (φ ↔ ψ))))  ((subst s x φ) ↔ ψ) ( x ψ DistinctNotFree H       makeSubstExplicitNotFree ))

thm (buildSubstReplacement ((H (s = t)))  ((subst s x φ) ↔ (subst t x φ)) ( H       s t x φ SubstBuilderReplacement applyModusPonens )) 

Composition
Substitution composition works just as in First-order logic in terms of substitution built on equality.

 thm (SubstitutionComposition ((φ y) (s y) (x y))  ((subst s y (subst (value y) x φ)) ↔ (subst s x φ)) ( (value y) s x φ SubstBuilderReplacement makeSubstExplicit )) 

EqualitySubst
Similarly, the proof from First-order logic in terms of substitution built on equality of  works here too.  thm (EqualitySubst  (((value x) = s) → (φ ↔ (subst s x φ))) ( (value x) s x φ SubstBuilderReplacement x φ SubstItself transformImplicationBiconditionalLeft )) 

Specialization and existential introduction without a substitution
The theorems  and   (which are special cases of the corresponding axioms which include substitutions) follow using the same proofs as in First-order logic in terms of substitution built on equality.  thm (Specialization  ((∀ x φ) → φ) ( x φ (value x) SpecializationToObject

x φ SubstItself eliminateBiconditionalReverse applySyllogism ))

thm (specialize ((H (∀ x φ))) φ ( H       x φ Specialization applyModusPonens ))

thm (ThereExistsIntroduction  (φ → (∃ x φ)) ( x φ SubstItself eliminateBiconditionalForward

(value x) x φ ThereExistsIntroductionFromObject applySyllogism )) 

The previous results let us conclude.  thm (ForAllThereExists  ((∀ x φ) → (∃ x φ)) ( x φ Specialization φ x ThereExistsIntroduction applySyllogism )) 

Generalization
Here we show that, provided that   is not free in.  thm (GeneralizationNotFree ((HFREE (x is-not-free-in φ))) (φ → (∀ x φ)) ( HFREE φ ImplicationReflexivity addForAllToConsequentNotFree )) 

We also can generalize a theorem, even if the variable is free in it. The proof proceeds by turning  into , adding the quantifier to the consequent, and then removing the antecedent.  thm (generalize ((H φ)) (∀ x φ) ( True

x (⊤) DistinctNotFree

H       (⊤) introduceAntecedent

addForAllToConsequentNotFree

applyModusPonens )) </jh>

Building for-all across implication
Here we differ from First-order logic in terms of substitution built on equality mainly because our axiom set is a bit different from the axioms used there, not primarily because of any differences between intuitionistic logic and classical logic. In particular, we don't have an axiom for  and related theorems, but need to derive them from   and the like. We start with the rule which lets us add  to both sides of an implication.  thm (addForAll ((H (φ → ψ))) ((∀ x φ) → (∀ x ψ)) ( x φ BoundForAllNotFree

x φ Specialization H       applySyllogism

addForAllToConsequentNotFree )) </jh>

The builder for the biconditional follows trivially:  thm (buildForAll ((H (φ ↔ ψ))) ((∀ x φ) ↔ (∀ x ψ)) ( H eliminateBiconditionalReverse x addForAll H eliminateBiconditionalForward x addForAll introduceBiconditionalFromImplications )) </jh>

For-all across an implication
We've just proved rules regarding distributing  across an implication or biconditional. There are corresponding non-rule theorems. For implication, this is.  thm (ForAllImplication  ((∀ x (φ → ψ)) → ((∀ x φ) → (∀ x ψ))) ( </jh> The proof is based on  (which follows from specialization and propositional logic). From there we'll be adding for-all to the consequent, so we start with.  x φ BoundForAllNotFree x (φ → ψ) BoundForAllNotFree conjunctionNotFree

x φ Specialization x (φ → ψ) Specialization conjoin

φ ψ ModusPonens applySyllogism

addForAllToConsequentNotFree export applyComm )) </jh>

More substitution
Now that we have proved builders, we can return to some more substitution results.

Builders
Here are some builders for which the proof from First-order logic in terms of substitution built on equality works verbatim.  thm (SubstBuilder  ((∀ x (φ ↔ ψ)) → ((subst s x φ) ↔ (subst s x ψ))) ( φ ψ BiconditionalReverseElimination x addForAll

x φ ψ s SubstAddition applySyllogism

φ ψ BiconditionalForwardElimination x addForAll

x ψ φ s SubstAddition applySyllogism

introduceBiconditionalFromImplicationsInConsequent ))

thm (addSubst ((H (φ → ψ))) ((subst s x φ) → (subst s x ψ)) ( H       x generalize x φ ψ s SubstAddition applyModusPonens ))

thm (buildSubst ((H (φ ↔ ψ))) ((subst s x φ) ↔ (subst s x ψ)) ( H       x generalize x φ ψ s SubstBuilder applyModusPonens )) </jh>

Moving substitution across negation
Substitution can be moved in or out of a predicate or operation, provided the predicate or operation has a builder. We start with the case where the predicate is  and the builder. Other than changing  to , the proof is as in First-order logic in terms of substitution built on equality, where it is explained in more detail.

We start with the special case in which the variable being substituted is distinct from its replacement.  thm (SubstNegationDistinct ((x s)) ((subst s x (¬ φ)) ↔ (¬ (subst s x φ))) ( x s φ SubstNotFree negateNotFree

x s φ EqualitySubst

φ (subst s x φ) NegationBuilder applySyllogism

makeSubstExplicitNotFree ))

thm (SubstNegation ( (y x) (y s) (y φ)) ((subst s x (¬ φ)) ↔ (¬ (subst s x φ))) ( s y x (¬ φ) SubstitutionComposition swapBiconditional

(value y) x φ SubstNegationDistinct s y buildSubst applyBiconditionalTransitivity

s y (subst (value y) x φ) SubstNegationDistinct applyBiconditionalTransitivity

s y x φ SubstitutionComposition addNegation applyBiconditionalTransitivity )) </jh>

Moving substitution across implication
The proof for other connectives is similar and also matches what we did in First-order logic in terms of substitution built on equality.  thm (SubstImplicationDistinct ((s x)) ((subst s x (φ → ψ)) ↔ ((subst s x φ) → (subst s x ψ))) ( x s φ SubstNotFree x s ψ SubstNotFree implicationNotFree

(value x) s x φ SubstBuilderReplacement (value x) s x ψ SubstBuilderReplacement buildImplicationInConsequent

x φ SubstItself x ψ SubstItself buildImplication transformImplicationBiconditionalLeft

makeSubstExplicitNotFree ))

thm (SubstImplication ( (y x) (y s) (y φ) (y ψ)) ((subst s x (φ → ψ)) ↔ ((subst s x φ) → (subst s x ψ))) ( s y x (φ → ψ) SubstitutionComposition swapBiconditional

(value y) x φ ψ SubstImplicationDistinct s y buildSubst applyBiconditionalTransitivity

s y (subst (value y) x φ) (subst (value y) x ψ) SubstImplicationDistinct applyBiconditionalTransitivity

s y x φ SubstitutionComposition s y x ψ SubstitutionComposition buildImplication applyBiconditionalTransitivity )) </jh>

Subst across disjunction, conjunction, and biconditional
Disjunction and conjunction are not related to implication and negation in as simple a manner as in classical logic, so we just prove the disjunction and conjunction results the same way we proved the implication and negation ones.  thm (SubstDisjunctionDistinct ((s x)) ((subst s x (φ ∨ ψ)) ↔ ((subst s x φ) ∨ (subst s x ψ))) ( x s φ SubstNotFree x s ψ SubstNotFree disjunctionNotFree

(value x) s x φ SubstBuilderReplacement (value x) s x ψ SubstBuilderReplacement buildDisjunctionInConsequent

x φ SubstItself x ψ SubstItself buildDisjunction transformImplicationBiconditionalLeft

makeSubstExplicitNotFree ))

thm (SubstDisjunction ( (y x) (y s) (y φ) (y ψ))  ((subst s x (φ ∨ ψ)) ↔ ((subst s x φ) ∨ (subst s x ψ))) ( s y x (φ ∨ ψ) SubstitutionComposition swapBiconditional

(value y) x φ ψ SubstDisjunctionDistinct s y buildSubst applyBiconditionalTransitivity

s y (subst (value y) x φ) (subst (value y) x ψ) SubstDisjunctionDistinct applyBiconditionalTransitivity

s y x φ SubstitutionComposition s y x ψ SubstitutionComposition buildDisjunction applyBiconditionalTransitivity ))

thm (SubstConjunctionDistinct ((s x)) ((subst s x (φ ∧ ψ)) ↔ ((subst s x φ) ∧ (subst s x ψ))) ( x s φ SubstNotFree x s ψ SubstNotFree conjunctionNotFree

(value x) s x φ SubstBuilderReplacement (value x) s x ψ SubstBuilderReplacement buildConjunctionInConsequent

x φ SubstItself x ψ SubstItself buildConjunction transformImplicationBiconditionalLeft

makeSubstExplicitNotFree ))

thm (SubstConjunction ( (y x) (y s) (y φ) (y ψ))  ((subst s x (φ ∧ ψ)) ↔ ((subst s x φ) ∧ (subst s x ψ))) ( s y x (φ ∧ ψ) SubstitutionComposition swapBiconditional

(value y) x φ ψ SubstConjunctionDistinct s y buildSubst applyBiconditionalTransitivity

s y (subst (value y) x φ) (subst (value y) x ψ) SubstConjunctionDistinct applyBiconditionalTransitivity

s y x φ SubstitutionComposition s y x ψ SubstitutionComposition buildConjunction applyBiconditionalTransitivity )) </jh>

The biconditional, on the other hand, can be defined in terms of implication and conjunction, as in classical logic. Therefore, it is more convenient to prove the corresponding theorem for the biconditional in terms of the theorems for implication and conjunction.

 thm (SubstBiconditional  ((subst s x (φ ↔ ψ)) ↔ ((subst s x φ) ↔ (subst s x ψ))) ( φ ψ BiconditionalImplication s x buildSubst

s x (φ → ψ) (ψ → φ) SubstConjunction applyBiconditionalTransitivity

s x φ ψ SubstImplication s x ψ φ SubstImplication buildConjunction applyBiconditionalTransitivity

(subst s x φ) (subst s x ψ) BiconditionalImplication swapBiconditional applyBiconditionalTransitivity )) </jh>

Quantifier commutation
Being able to exchange the order of universal quantifiers is proved just as in First-order logic in terms of substitution built on equality.  thm (ForAllCommutationImplication  ((∀ x (∀ y φ)) → (∀ y (∀ x φ))) (

x (∀ y φ) BoundForAllNotFree GeneralizationNotFree

y φ BoundForAllNotFree x addForAllNotFree x addForAllNotFree GeneralizationNotFree applySyllogism

y φ Specialization x addForAll x addForAll y addForAll applySyllogism

x φ Specialization x addForAll y addForAll applySyllogism ))

thm (ForAllCommutation  ((∀ x (∀ y φ)) ↔ (∀ y (∀ x φ))) ( x y φ ForAllCommutationImplication y x φ ForAllCommutationImplication introduceBiconditionalFromImplications )) </jh>

Adding and removing quantifiers
The biconditionalized thereorem  works just as in First-order logic in terms of substitution built on equality.

 thm (ForAllAddRemoveNotFree ((XFREE (x is-not-free-in φ))) ((∀ x φ) ↔ φ) ( x φ Specialization

XFREE GeneralizationNotFree

introduceBiconditionalFromImplications )) </jh>

Moving is-not-free-in across connectives
We've adopted as axioms the ability the move  across most connectives. The one remaining is the biconditional, which follows from the axioms for implication and conjunction.

 thm (biconditionalNotFree  ((HPHI (x is-not-free-in φ)) (HPSI (x is-not-free-in ψ)))  (x is-not-free-in (φ ↔ ψ)) ( HPHI HPSI implicationNotFree

HPSI HPHI implicationNotFree

conjunctionNotFree

φ ψ BiconditionalImplication x buildNotFree eliminateBiconditionalForward applyModusPonens )) </jh>

Adding there exists to the antecedent
We have as an axiom the rule that one can add there exists to the antecedent if the variable of quantification is not free in the consequent. In this section we prove some variations of this rule and consequences of it.

Distinct variable version
Here's the special case where the variable does not occur in the consequent.  thm (addThereExistsToAntecedent ((x ψ)) ((H (φ → ψ)))  ((∃ x φ) → ψ) ( x ψ DistinctNotFree H       addThereExistsToAntecedentNotFree )) </jh>

Non-rule form
Here is a non-rule form of adding there-exists to the antecedent.  thm (ThereExistsAntecedentIntroductionNotFree  ((HFREE (x is-not-free-in ψ)))  ((∀ x (φ → ψ)) → ((∃ x φ) → ψ)) ( </jh> The proof first constructs  (from specialization and propositional logic) and then adds there-exists to the antecedent. We start with.  x (φ → ψ) BoundForAllNotFree HFREE implicationNotFree

x (φ → ψ) Specialization applyComm

addThereExistsToAntecedentNotFree applyComm )) </jh>

There exists across a conjunction
The proof of  works as in First-order logic in terms of substitution built on equality without modification. <jh> thm (ThereExistsConjunction  ((∃ x (φ ∧ ψ)) → ((∃ x φ) ∧ (∃ x ψ))) ( x φ BoundThereExistsNotFree x ψ BoundThereExistsNotFree conjunctionNotFree

φ ψ ConjunctionRightElimination

φ x ThereExistsIntroduction applySyllogism

φ ψ ConjunctionLeftElimination

ψ x ThereExistsIntroduction applySyllogism

composeConjunction

addThereExistsToAntecedentNotFree )) </jh>

Adding there exists to both sides of an implication
We prove  as in First-order logic in terms of substitution built on equality. <jh> thm (ForAllImplicationThereExists  ((∀ x (φ → ψ)) → ((∃ x φ) → (∃ x ψ))) ( ψ x ThereExistsIntroduction φ addCommonAntecedent x addForAll

x ψ BoundThereExistsNotFree φ ThereExistsAntecedentIntroductionNotFree

applySyllogism ))

thm (addThereExists ((H (φ → ψ))) ((∃ x φ) → (∃ x ψ)) ( H       x generalize x φ ψ ForAllImplicationThereExists applyModusPonens )) </jh>

There exists commutation
Being able to swap the order of two existential quantifiers,, follows from the proof in First-order logic in terms of substitution built on equality (which, by not being based on the corresponding theorem for  , works in intuitionistic logic). <jh> thm (ThereExistsCommutationImplication  ((∃ x (∃ y φ)) → (∃ y (∃ x φ))) ( x φ BoundThereExistsNotFree y addThereExistsNotFree

y (∃ x φ) BoundThereExistsNotFree

φ x ThereExistsIntroduction

(∃ x φ) y ThereExistsIntroduction applySyllogism

addThereExistsToAntecedentNotFree

addThereExistsToAntecedentNotFree ))

thm (ThereExistsCommutation  ((∃ x (∃ y φ)) ↔ (∃ y (∃ x φ))) ( x y φ ThereExistsCommutationImplication y x φ ThereExistsCommutationImplication introduceBiconditionalFromImplications )) </jh>

Adding for-all to the consequent
Although the proof of  from First-order logic in terms of substitution built on equality would work here, at least for now we omit it, as we already have.

Here's a distinct variable version of.

<jh> thm (addForAllToConsequent ((x φ)) ((H (φ → ψ)))  (φ → (∀ x ψ)) ( x φ DistinctNotFree H       addForAllToConsequentNotFree )) </jh>

For all across a biconditional
We can distribute for all across a biconditional, and the proof in First-order logic in terms of substitution built on equality works here without modification. <jh> thm (ForAllBiconditionalImplication  ((∀ x (φ ↔ ψ)) → ((∀ x φ) → (∀ x ψ))) ( φ ψ BiconditionalReverseElimination x addForAll

x φ ψ ForAllImplication applySyllogism ))

thm (ForAllBiconditional  ((∀ x (φ ↔ ψ)) → ((∀ x φ) ↔ (∀ x ψ))) ( x φ ψ ForAllBiconditionalImplication

φ ψ BiconditionalSymmetry eliminateBiconditionalReverse x addForAll

x ψ φ ForAllBiconditionalImplication applySyllogism

introduceBiconditionalFromImplicationsInConsequent )) </jh>

Adding there-exists to both sides of a biconditional
The counterpart to  follows from. The proof in First-order logic in terms of substitution built on equality is based on the relationship between  and   which holds in classical logic but not in intuitionistic logic. <jh> thm (buildThereExists ((H (φ ↔ ψ))) ((∃ x φ) ↔ (∃ x ψ)) ( H eliminateBiconditionalReverse x addThereExists H eliminateBiconditionalForward x addThereExists introduceBiconditionalFromImplications )) </jh>

Change of variable in ∀
The proof in First-order logic in terms of substitution built on equality holds as-is.

<jh> thm (ChangeVariableForAllImplicationNotFree ((x y)) ((HFREEX (x is-not-free-in φy)) (HFREEY (y is-not-free-in φx)) (H (((value x) = (value y)) → (φx ↔ φy))) ) ((∀ x φx) → (∀ y φy)) ( HFREEY x addForAllNotFree x φx (value y) SpecializationToObject addForAllToConsequentNotFree

HFREEX H       makeSubstExplicitNotFree

eliminateBiconditionalReverse y addForAll applySyllogism ))

thm (ChangeVariableForAllNotFree ((x y)) ((HFREEX (x is-not-free-in φy)) (HFREEY (y is-not-free-in φx)) (H (((value x) = (value y)) → (φx ↔ φy))) ) ((∀ x φx) ↔ (∀ y φy)) ( HFREEX HFREEY H ChangeVariableForAllImplicationNotFree

HFREEY HFREEX H       (value x) (value y) EqualitySymmetry transformAntecedent

φx φy BiconditionalSymmetry eliminateBiconditionalReverse applySyllogism

ChangeVariableForAllImplicationNotFree

introduceBiconditionalFromImplications ))

thm (ChangeVariableForAll ((y φx) (x φy) (x y)) ((H (((value x) = (value y)) → (φx ↔ φy))))  ((∀ x φx) ↔ (∀ y φy)) ( x φy DistinctNotFree y φx DistinctNotFree H       ChangeVariableForAllNotFree )) </jh>

Change of variable in ∃
We prove the similar theorem for  in a similar way, in which we rewrite   to   and then to.

<jh> thm (ChangeVariableThereExistsImplicationNotFree ((x y)) ((HFREEX (x is-not-free-in φy)) (HFREEY (y is-not-free-in φx)) (H (((value x) = (value y)) → (φx ↔ φy))) ) ((∃ y φy) → (∃ x φx)) ( </jh> We start with. <jh> HFREEY x addThereExistsNotFree </jh> Next is. <jh> HFREEX H       makeSubstExplicitNotFree eliminateBiconditionalForward </jh> Then we can combine that with. <jh> (value y) x φx ThereExistsIntroductionFromObject applySyllogism

addThereExistsToAntecedentNotFree )) </jh>

Now that we've proved the implication, we just need to biconditionalize it and also would like a variant with distinct variables rather than freeness hypotheses. <jh> thm (ChangeVariableThereExistsNotFree ((x y)) ((HFREEX (x is-not-free-in φy)) (HFREEY (y is-not-free-in φx)) (H (((value x) = (value y)) → (φx ↔ φy))) ) ((∃ x φx) ↔ (∃ y φy)) ( HFREEY HFREEX H       (value x) (value y) EqualitySymmetry transformAntecedent

φx φy BiconditionalSymmetry eliminateBiconditionalReverse applySyllogism

ChangeVariableThereExistsImplicationNotFree

HFREEX HFREEY H ChangeVariableThereExistsImplicationNotFree

introduceBiconditionalFromImplications ))

thm (ChangeVariableThereExists ((y φx) (x φy) (x y)) ((H (((value x) = (value y)) → (φx ↔ φy))))  ((∃ x φx) ↔ (∃ y φy)) ( x φy DistinctNotFree y φx DistinctNotFree H       ChangeVariableThereExistsNotFree )) </jh>

Stating changes of variable in terms of explicit substitutions
Another way to express the change variable theorems is with explicit substitution (using ). The proofs from First-order logic with quantifiability work without modification. <jh> thm (ChangeVariableExplicitThereExists ((y φ) (x y)) ((∃ x φ) ↔ (∃ y (subst (value y) x φ))) ( x (value y) φ SubstNotFree y φ DistinctNotFree x (value y) φ EqualitySubst ChangeVariableThereExistsNotFree ))

thm (ChangeVariableExplicitForAll ((y φ) (x y)) ((∀ x φ) ↔ (∀ y (subst (value y) x φ))) ( x (value y) φ SubstNotFree y φ DistinctNotFree x (value y) φ EqualitySubst ChangeVariableForAllNotFree )) </jh>

Adding and removing there exists
Here are a number of results involving removing. The proofs in First-order logic in terms of substitution built on equality apply without modification. <jh> thm (ThereExistsAddRemoveNotFree ((HFREE (x is-not-free-in φ))) ((∃ x φ) ↔ φ) ( HFREE φ ImplicationReflexivity addThereExistsToAntecedentNotFree

φ x ThereExistsIntroduction

introduceBiconditionalFromImplications ))

thm (NullThereExists ((x φ)) ((∃ x φ) ↔ φ) ( x φ DistinctNotFree ThereExistsAddRemoveNotFree ))

thm (removeThereExists ((x φ)) ((H (∃ x φ))) φ ( H       x φ NullThereExists eliminateBiconditionalReverse applyModusPonens ))

thm (removeThereExistsInConsequent ((x φ)) ((H (antecedent → (∃ x φ)))) (antecedent → φ) ( H       x φ NullThereExists eliminateBiconditionalReverse applySyllogism )) </jh>

Relationship between universal and existential quantification
In classical first-order logic, there are a number of equivalences involving negation and both kinds of quantifiers. Only some of them hold intuitionistically.

The first one is. This is a biconditional in classical logic, but this direction holds intuitionistically. <jh> thm (NotForAllReverse  ((∃ x (¬ φ)) → (¬ (∀ x φ))) ( x φ BoundForAllNotFree negateNotFree

x φ Specialization introduceTransposition

addThereExistsToAntecedentNotFree )) </jh>

Next is. The forward direction is much like the previous proof. <jh> thm (NotThereExistsForward  ((¬ (∃ x φ)) → (∀ x (¬ φ))) ( x φ BoundThereExistsNotFree negateNotFree

φ x ThereExistsIntroduction introduceTransposition

addForAllToConsequentNotFree )) </jh>

We prove the reverse direction by rewriting  as   and applying. <jh> thm (NotThereExistsReverse  ((∀ x (¬ φ)) → (¬ (∃ x φ))) ( φ NegationImplication eliminateBiconditionalReverse x addForAll

x φ (⊥) ForAllImplicationThereExists applySyllogism </jh> Now we have  and we can remove the second   because the variable   does not occur in the formula. <jh> import removeThereExistsInConsequent export

(∃ x φ) NegationImplication eliminateBiconditionalForward applySyllogism ))

thm (NotThereExists  ((¬ (∃ x φ)) ↔ (∀ x (¬ φ))) ( x φ NotThereExistsForward x φ NotThereExistsReverse introduceBiconditionalFromImplications )) </jh>

Commuting ∃ followed by ∀
∃ followed by ∀ can be switched. We don't need any modifications to the proof in First-order logic in terms of substitution built on equality. <jh> thm (ThereExistsForAllCommutation  ((∃ x (∀ y φ)) → (∀ y (∃ x φ))) ( y φ BoundForAllNotFree x addThereExistsNotFree

x φ BoundThereExistsNotFree

y φ Specialization φ x ThereExistsIntroduction applySyllogism

addThereExistsToAntecedentNotFree

addForAllToConsequentNotFree )) </jh>

Biconditionalized version of ForAllImplicationThereExists
This is a biconditionalized variation of a theorem we already proved, using the proof from First-order logic in terms of substitution built on equality. <jh> thm (ForAllBiconditionalThereExists  ((∀ x (φ ↔ ψ)) → ((∃ x φ) ↔ (∃ x ψ))) ( φ ψ BiconditionalReverseElimination x addForAll

x φ ψ ForAllImplicationThereExists applySyllogism

φ ψ BiconditionalForwardElimination x addForAll

x ψ φ ForAllImplicationThereExists applySyllogism

introduceBiconditionalFromImplicationsInConsequent )) </jh>

Distribution of for-all over conjunction
Next is, proved the same way as First-order logic in terms of substitution built on equality. <jh> thm (ForAllConjunctionForward  ((∀ x (φ ∧ ψ)) → ((∀ x φ) ∧ (∀ x ψ))) ( φ ψ ConjunctionRightElimination x addForAll

φ ψ ConjunctionLeftElimination x addForAll

composeConjunction ))

thm (ForAllConjunctionReverse  (((∀ x φ) ∧ (∀ x ψ)) → (∀ x (φ ∧ ψ))) ( x φ BoundForAllNotFree x ψ BoundForAllNotFree conjunctionNotFree

(∀ x φ) (∀ x ψ) ConjunctionRightElimination x φ Specialization applySyllogism

(∀ x φ) (∀ x ψ) ConjunctionLeftElimination x ψ Specialization applySyllogism

composeConjunction

addForAllToConsequentNotFree ))

thm (ForAllConjunction  ((∀ x (φ ∧ ψ)) ↔ ((∀ x φ) ∧ (∀ x ψ))) ( x φ ψ ForAllConjunctionForward x φ ψ ForAllConjunctionReverse introduceBiconditionalFromImplications )) </jh>

Distribution of there-exists across a disjunction
Here is. Since DeMorgan's law and the relationship between negation and quantification does not follow the rules of classical logic, we cannot just derive it from the previous theorem (the one about conjunction and ). However, the proof in First-order logic in terms of substitution built on equality does work fine. <jh> thm (ThereExistsDisjunctionSplitting  ((∃ x (φ ∨ ψ)) → ((∃ x φ) ∨ (∃ x ψ))) ( x φ BoundThereExistsNotFree x ψ BoundThereExistsNotFree disjunctionNotFree

φ x ThereExistsIntroduction ψ x ThereExistsIntroduction disjoin

addThereExistsToAntecedentNotFree ))

thm (ThereExistsDisjunctionCombining  (((∃ x φ) ∨ (∃ x ψ)) → (∃ x (φ ∨ ψ))) ( φ ψ DisjunctionRightIntroduction x addThereExists

ψ φ DisjunctionLeftIntroduction x addThereExists

composeDisjunction ))

thm (ThereExistsDisjunction  ((∃ x (φ ∨ ψ)) ↔ ((∃ x φ) ∨ (∃ x ψ))) ( x φ ψ ThereExistsDisjunctionSplitting x φ ψ ThereExistsDisjunctionCombining introduceBiconditionalFromImplications )) </jh>

Distribution of there-exists across an implication
When distributing ∃ across an implication, the quantifier on the antecedent changes to ∀. In classical logic this is a biconditional. The forward direction is easy to prove in intuitionistic logic, but the reverse direction doesn't work, at least not using the proof in First-order logic in terms of substitution built on equality. <jh> thm (ThereExistsImplicationForward  ((∃ x (φ → ψ)) → ((∀ x φ) → (∃ x ψ))) ( x φ BoundForAllNotFree x ψ BoundThereExistsNotFree implicationNotFree

</jh> Next is  and , which we combine into. <jh> x φ Specialization ψ addCommonConsequent

ψ x ThereExistsIntroduction (∀ x φ) addCommonAntecedent applySyllogism

addThereExistsToAntecedentNotFree )) </jh>

Movement
There are a variety of theorems which involve moving a formula in or out of the scope of a quantifier (where the variable being quantified is not free in the formula). In intuitionistic logic most of these can be proved as in First-order logic in terms of substitution built on equality.

There exists and conjunction
<jh> thm (ThereExistsConjunctionMovementNotFree ((HFREE (x is-not-free-in φ)))  ((∃ x (φ ∧ ψ)) ↔ (φ ∧ (∃ x ψ))) ( x φ ψ ThereExistsConjunction

HFREE ThereExistsAddRemoveNotFree eliminateBiconditionalReverse (∃ x ψ) conjoinRR applySyllogism

HFREE φ ψ ConjunctionRightIntroduction addForAllToConsequentNotFree

x ψ (φ ∧ ψ) ForAllImplicationThereExists applySyllogism

import introduceBiconditionalFromImplications ))

thm (ThereExistsConjunctionMovement ((x φ)) ((∃ x (φ ∧ ψ)) ↔ (φ ∧ (∃ x ψ))) ( x φ DistinctNotFree ψ ThereExistsConjunctionMovementNotFree ))

thm (ThereExistsConjunctionRightMovement ((x ψ)) ((∃ x (φ ∧ ψ)) ↔ ((∃ x φ) ∧ ψ)) ( φ ψ ConjunctionCommutativity x buildThereExists

x ψ φ ThereExistsConjunctionMovement applyBiconditionalTransitivity

ψ (∃ x φ) ConjunctionCommutativity applyBiconditionalTransitivity )) </jh>

For all and implication
<jh> thm (ForAllImplicationAntecedentMovement ((HFREE (x is-not-free-in φ))) ((∀ x (φ → ψ)) ↔ (φ → (∀ x ψ))) ( x φ ψ ForAllImplication

HFREE GeneralizationNotFree (∀ x ψ) addCommonConsequent applySyllogism

HFREE x ψ BoundForAllNotFree implicationNotFree

x ψ Specialization φ addCommonAntecedent

addForAllToConsequentNotFree

introduceBiconditionalFromImplications ))

thm (moveAntecedentOutOfForAll ((H (∀ x (φ → ψ))) (HFREE (x is-not-free-in φ))) (φ → (∀ x ψ)) ( H

HFREE ψ ForAllImplicationAntecedentMovement eliminateBiconditionalReverse

applyModusPonens ))

thm (moveAntecedentIntoForAll  ((H (φ → (∀ x ψ))) (HFREE (x is-not-free-in φ)))  (∀ x (φ → ψ)) ( H

HFREE ψ ForAllImplicationAntecedentMovement eliminateBiconditionalForward

applyModusPonens )) </jh>

Moving antecedent in or out of there exists
Here we only provide the forward direction, as we only have the forward direction of. <jh> thm (ThereExistsAntecedentMovementForwardNotFree  ((HFREE (x is-not-free-in φ))) ((∃ x (φ → ψ)) → (φ → (∃ x ψ))) ( x φ ψ ThereExistsImplicationForward

HFREE ForAllAddRemoveNotFree (∃ x ψ) buildImplicationConsequent eliminateBiconditionalReverse

applySyllogism ))

thm (ThereExistsAntecedentMovementForward ((x φ)) ((∃ x (φ → ψ)) → (φ → (∃ x ψ))) ( x φ DistinctNotFree ψ ThereExistsAntecedentMovementForwardNotFree )) </jh>

Moving the consequent in or out of for all
When we move the consequent out of, it changes to  , and we can prove it just as in First-order logic in terms of substitution built on equality. <jh> thm (ForAllImplicationConsequentMovement ((HFREE (x is-not-free-in ψ))) ((∀ x (φ → ψ)) ↔ ((∃ x φ) → ψ)) ( x φ ψ ForAllImplicationThereExists

HFREE ThereExistsAddRemoveNotFree eliminateBiconditionalReverse (∃ x φ) addCommonAntecedent applySyllogism

x φ BoundThereExistsNotFree HFREE implicationNotFree

φ x ThereExistsIntroduction ψ addCommonConsequent

addForAllToConsequentNotFree

introduceBiconditionalFromImplications )) </jh>

Moving the consequent in or out of there exists
Similar to the previous one, but with ∃ and ∀ exchanged. We only have one direction, as it relies on. <jh> thm (ThereExistsImplicationConsequentMovementForward ((HFREE (x is-not-free-in ψ)))  ((∃ x (φ → ψ)) → ((∀ x φ) → ψ)) ( x φ ψ ThereExistsImplicationForward

HFREE ThereExistsAddRemoveNotFree (∀ x φ) buildImplicationAntecedent eliminateBiconditionalReverse

applySyllogism )) </jh>

Disjunction movement
We can move a conjunct out of or into there exists, and the proofs in First-order logic in terms of substitution built on equality hold here too. <jh> thm (ThereExistsDisjunctionMovementNotFree ((HFREE (x is-not-free-in φ)))  ((∃ x (φ ∨ ψ)) ↔ (φ ∨ (∃ x ψ))) ( x φ ψ ThereExistsDisjunction

HFREE ThereExistsAddRemoveNotFree (∃ x ψ) buildDisjunctionRR

applyBiconditionalTransitivity ))

thm (ThereExistsDisjunctionMovement ((x φ)) ((∃ x (φ ∨ ψ)) ↔ (φ ∨ (∃ x ψ))) ( x φ DistinctNotFree ψ ThereExistsDisjunctionMovementNotFree ))

thm (ThereExistsDisjunctionRightMovementNotFree ((HFREE (x is-not-free-in ψ)))  ((∃ x (φ ∨ ψ)) ↔ ((∃ x φ) ∨ ψ)) ( x φ ψ ThereExistsDisjunction

HFREE ThereExistsAddRemoveNotFree (∃ x φ) buildDisjunctionLL

applyBiconditionalTransitivity ))

thm (ThereExistsDisjunctionRightMovement ((x ψ)) ((∃ x (φ ∨ ψ)) ↔ ((∃ x φ) ∨ ψ)) ( x ψ DistinctNotFree φ ThereExistsDisjunctionRightMovementNotFree )) </jh>

A few more movement rules
Here are a few rules, for convenience: <jh> thm (moveLeftConjunctIntoThereExistsInConsequent ((x φ)) ((H (antecedent → (φ ∧ (∃ x ψ)))))  (antecedent → (∃ x (φ ∧ ψ))) ( H

x φ ψ ThereExistsConjunctionMovement eliminateBiconditionalForward applySyllogism ))

thm (moveRightConjunctIntoThereExistsInConsequent ((x ψ)) ((H (antecedent → ((∃ x φ) ∧ ψ))))  (antecedent → (∃ x (φ ∧ ψ))) ( H

x φ ψ ThereExistsConjunctionRightMovement eliminateBiconditionalForward applySyllogism ))

thm (repeatAntecedentThereExists ((x antecedent)) ((H (antecedent → (∃ x ψ))))  (antecedent → (∃ x (antecedent ∧ ψ))) ( antecedent ImplicationReflexivity H       composeConjunction moveLeftConjunctIntoThereExistsInConsequent )) </jh>

Combining one universal and one existential quantifier
Suppose we have one formula which holds for all values of a variable, and another which holds for some value. Then there is a value for which both hold. In symbols,, which we prove as in First-order logic in terms of substitution built on equality. <jh> thm (ThereExistsConjunctionCombining   (((∀ x φ) ∧ (∃ x ψ)) → (∃ x (φ ∧ ψ))) ( x φ BoundForAllNotFree ψ ThereExistsConjunctionMovementNotFree eliminateBiconditionalForward

x φ Specialization ψ conjoinRR x addThereExists applySyllogism ))

thm (ThereExistsConjunctionRightCombining   (((∃ x φ) ∧ (∀ x ψ)) → (∃ x (φ ∧ ψ))) ( (∃ x φ) (∀ x ψ) ConjunctionCommutativity eliminateBiconditionalReverse

x ψ φ ThereExistsConjunctionCombining applySyllogism

ψ φ ConjunctionCommutativity eliminateBiconditionalReverse x addThereExists applySyllogism ))

thm (combineThereExistsForAll ((HEXISTS (∃ x φ)) (HALL (∀ x ψ))) (∃ x (φ ∧ ψ)) ( HEXISTS HALL introduceConjunction

x φ ψ ThereExistsConjunctionRightCombining applyModusPonens )) </jh>

Scattering and gathering
The rules and theorems we call scattering and gathering are just consequences of the movement theorems, and as such we can use the exact same proofs as in First-order logic. <jh> thm (ThereExistsScattering ((φx y) (ψy x))  ((∃ x (∃ y (φx ∧ ψy))) ↔ ((∃ x φx) ∧ (∃ y ψy))) ( (∃ x φx) (∃ y ψy) ConjunctionCommutativity

x ψy DistinctNotFree y addThereExistsNotFree φx ThereExistsConjunctionMovementNotFree swapBiconditional applyBiconditionalTransitivity

(∃ y ψy) φx ConjunctionCommutativity x buildThereExists applyBiconditionalTransitivity

y φx ψy ThereExistsConjunctionMovement swapBiconditional x buildThereExists applyBiconditionalTransitivity

swapBiconditional ))

thm (gatherThereExistsInConsequent ((φx y) (ψy x)) ((H (antecedent → ((∃ x φx) ∧ (∃ y ψy))))) (antecedent → (∃ x (∃ y (φx ∧ ψy)))) ( H       x y φx ψy ThereExistsScattering eliminateBiconditionalForward applySyllogism )) </jh>

Other theorems
Here we present a few theorems which are convenience theorems, or other fairly simple deductions from theorems we have. <jh> thm (buildThereExistsInConsequent ((x antecedent)) ((H (antecedent → (φ ↔ ψ))))  (antecedent → ((∃ x φ) ↔ (∃ x ψ))) ( H       x addForAllToConsequent

x φ ψ ForAllBiconditionalThereExists applySyllogism ))

thm (buildForAllInConsequent ((x antecedent)) ((H (antecedent → (φ ↔ ψ))))  (antecedent → ((∀ x φ) ↔ (∀ x ψ))) ( H       x addForAllToConsequent

x φ ψ ForAllBiconditional applySyllogism ))

thm (Generalization ((x φ)) (φ → (∀ x φ)) ( x φ DistinctNotFree GeneralizationNotFree )) </jh>

Equality
Having adopted the most interesting equality theorems (reflexivity, symmetry, and transitivity) as axioms, we mostly have convenience theorems to prove, and can do so as in First-order logic. <jh> def ((≠ s t) (¬ (s = t)))

thm (swapEquality ((H (s = t))) (t = s) ( H       s t EqualitySymmetry eliminateBiconditionalReverse applyModusPonens ))

thm (swapEqualityInConsequent ((H (φ → (s = t)))) (φ → (t = s)) ( H       s t EqualitySymmetry eliminateBiconditionalReverse applySyllogism ))

thm (applyEqualityTransitivity ((H1 (s = t)) (H2 (t = u))) (s = u) ( H1       H2        introduceConjunction s t u EqualityTransitivity applyModusPonens ))

thm (applyEqualityTransitivityInConsequent ((H1 (φ → (s = t))) (H2 (φ → (t = u)))) (φ → (s = u)) ( H1       H2        composeConjunction s t u EqualityTransitivity applySyllogism ))

thm (EqualityBuilderRR  ((s0 = s1) → ((s0 = t) ↔ (s1 = t))) ( s0 s1 EqualitySymmetry eliminateBiconditionalReverse

s1 s0 t EqualityTransitivity export

applySyllogism

s0 s1 t EqualityTransitivity export

composeConjunction

(s0 = t) (s1 = t) BiconditionalImplication eliminateBiconditionalForward applySyllogism ))

thm (commute2  (((s0 = t0) ↔ (s1 = t1)) → ((t0 = s0) ↔ (t1 = s1))) ( s0 t0 EqualitySymmetry s1 t1 EqualitySymmetry buildBiconditional eliminateBiconditionalReverse ))

thm (EqualityBuilderLL  ((s0 = s1) → ((t = s0) ↔ (t = s1))) ( s0 s1 t EqualityBuilderRR s0 t s1 t commute2 applySyllogism ))

thm (EqualityBuilder  (((s0 = s1) ∧ (t0 = t1)) → ((s0 = t0) ↔ (s1 = t1))) ( (s0 = s1) (t0 = t1) ConjunctionRightElimination s0 s1 t0 EqualityBuilderRR applySyllogism

(s0 = s1) (t0 = t1) ConjunctionLeftElimination t0 t1 s1 EqualityBuilderLL applySyllogism

composeConjunction

(s0 = t0) (s1 = t0) (s1 = t1) BiconditionalTransitivity applySyllogism ))

thm (buildEquality ((HX (s0 = s1)) (HY (t0 = t1))) ((s0 = t0) ↔ (s1 = t1)) ( HX       HY        introduceConjunction s0 s1 t0 t1 EqualityBuilder applyModusPonens ))

thm (buildEqualityRR ((H (s0 = s1))) ((s0 = t) ↔ (s1 = t)) ( H       t EqualityReflexivity introduceConjunction

s0 s1 t t EqualityBuilder

applyModusPonens ))

thm (buildEqualityLL ((H (t0 = t1))) ((s = t0) ↔ (s = t1)) ( s EqualityReflexivity H       introduceConjunction

s s t0 t1 EqualityBuilder

applyModusPonens ))

thm (buildEqualityInConsequent  ((HN (φ → (s0 = s1))) (HM (φ → (t0 = t1)))) (φ → ((s0 = t0) ↔ (s1 = t1))) ( HN HM composeConjunction s0 s1 t0 t1 EqualityBuilder applySyllogism ))

thm (buildEqualityRRInConsequent  ((H (φ → (s0 = s1))))  (φ → ((s0 = t) ↔ (s1 = t))) ( H       t EqualityReflexivity φ introduceAntecedent buildEqualityInConsequent ))

thm (buildEqualityLLInConsequent  ((H (φ → (t0 = t1))))  (φ → ((s = t0) ↔ (s = t1))) ( s EqualityReflexivity φ introduceAntecedent H       buildEqualityInConsequent )) </jh>

A rule for there-exists introduction
We haven't gotten around to adding a rule form of  until now: <jh> thm (introduceThereExistsFromObject ((H (subst s x φ))) (∃ x φ) ( H       s x φ ThereExistsIntroductionFromObject applyModusPonens )) </jh>

Quantifiability
We prove quantifiability as in First-order logic in terms of substitution built on equality. <jh> thm (Quantifiability ((x s)) (∃ x ((value x) = s)) ( s EqualityReflexivity

(value x) s s EqualityBuilderRR

makeSubstExplicit eliminateBiconditionalForward applyModusPonens

introduceThereExistsFromObject )) </jh>

Variable to term
Converting a variable to a term is no different than in First-order logic in terms of substitution built on equality. <jh> thm (VariableToObject ((x s) (x φs)) ((HSUBST (((value x) = s) → (φx ↔ φs))) (H φx) ) φs ( H       x generalize

x φx s SpecializationToObject applyModusPonens

HSUBST makeSubstExplicit eliminateBiconditionalReverse applyModusPonens )) </jh>

Substitution
Although our axioms were based on substitution and we've proved many of the substitution theorems we need, here are a few more consequences and convenience theorems. Nothing specific to intuitionistic logic here, we just follow proofs from First-order logic in terms of substitution built on equality.

Substitution of a theorem remains a theorem
If we have a theorem, we can add a variable substitution onto it. This is just a generalization followed by specializeToObject. <jh> thm (introduceSubst ((H φ)) (subst s x φ) ( H       x generalize s specializeToObject )) </jh>

Moving substitution across quantifiers
We have already shown we can move substitution across connectives. We can also move it across quantifiers (when variables are distinct). <jh> thm (SubstThereExists ((x y s)) ((subst s x (∃ y φ)) ↔ (∃ y (subst s x φ))) ( x s φ SubstNotFree y addThereExistsNotFree

x s φ EqualitySubst

y buildThereExistsInConsequent makeSubstExplicitNotFree )) </jh>

Substitution of a variable which does not appear
If a variable does not appear in a formula, substituting it for anything does not affect the truth of the formula. <jh> thm (NullSubstitution ((x φ)) ((subst s x φ) ↔ φ) ( s x φ ThereExistsIntroductionFromObject removeThereExistsInConsequent

φ x Generalization x φ s SpecializationToObject applySyllogism

introduceBiconditionalFromImplications )) </jh>

A lemma regarding substitution and equality
Here we show. <jh> thm (SubstEquality ((x s)) (subst s x ((value x) = s)) ( s EqualityReflexivity

(value x) s s EqualityBuilderRR makeSubstExplicit

eliminateBiconditionalForward applyModusPonens )) </jh>

Change of variable in substitution
Changing the bound variable in a substitution is possible, much as we do for quantifiers. <jh> thm (ChangeVariableSubstitution-1 ((x y) (s x) (s y))   (subst s y (subst s x ((value x) = (value y)))) ( s x SubstEquality

(value y) s (value x) EqualityBuilderLL x addForAllToConsequent

x ((value x) = (value y)) ((value x) = s) s SubstBuilder applySyllogism

makeSubstExplicit

eliminateBiconditionalForward applyModusPonens ))

thm (ChangeVariableSubstitution ((y φx) (x φy) (x y) (s x) (s y))  ((H (((value x) = (value y)) → (φx ↔ φy))))  ((subst s x φx) ↔ (subst s y φy)) ( </jh> We'll stick our lemma on the proof stack for later. <jh> s y x ChangeVariableSubstitution-1

H

s x addSubst

s x φx φy SubstBiconditional eliminateBiconditionalReverse applySyllogism

s y addSubst

s y (subst s x φx) (subst s x φy) SubstBiconditional eliminateBiconditionalReverse applySyllogism

applyModusPonens

swapBiconditional s y (subst s x φx) NullSubstitution applyBiconditionalTransitivity swapBiconditional

s x φy NullSubstitution s y buildSubst applyBiconditionalTransitivity )) </jh>

Implicit substitution and universal quantification
One way to express a substitution is. <jh> thm (ImplicitForAll-1 ((x s) (x ψ))  ((subst s x φ) → (∀ x (((value x) = s) → φ))) ( x s φ SubstNotFree

x s φ EqualitySubst eliminateBiconditionalForwardInConsequent applyComm

addForAllToConsequentNotFree ))

thm (ImplicitForAll-2 ((x s) (x ψ))  ((∀ x (((value x) = s) → φ)) → (subst s x φ)) ( s x SubstEquality

x (((value x) = s) → φ) s SpecializationToObject

s x ((value x) = s) φ SubstImplication eliminateBiconditionalReverse applySyllogism

detachImplicationImplication ))

thm (ImplicitForAll ((x s) (x ψ)) ((H (((value x) = s) → (φ ↔ ψ)))) ((∀ x (((value x) = s) → φ)) ↔ ψ) ( x s φ ImplicitForAll-2 s x φ ImplicitForAll-1 introduceBiconditionalFromImplications

H       makeSubstExplicit

applyBiconditionalTransitivity )) </jh>

Implicit substitution and existential quantification
There is another similar expression, involving, namely. <jh> thm (ImplicitThereExists-1 ((x s))  ((subst s x φ) → (∃ x (((value x) = s) ∧ φ))) ( (subst s x φ) ImplicationReflexivity s x SubstEquality introduceLeftConjunctToConsequent

s x ((value x) = s) φ SubstConjunction eliminateBiconditionalForward applySyllogism

s x (((value x) = s) ∧ φ) ThereExistsIntroductionFromObject applySyllogism ))

thm (ImplicitThereExists-2 ((x s))  ((∃ x (((value x) = s) ∧ φ)) → (subst s x φ)) ( x s φ SubstNotFree

x s φ EqualitySubst

eliminateBiconditionalReverseInConsequent import

addThereExistsToAntecedentNotFree ))

thm (ImplicitThereExists ((x s) (x ψ)) ((H (((value x) = s) → (φ ↔ ψ)))) ((∃ x (((value x) = s) ∧ φ)) ↔ ψ) ( x s φ ImplicitThereExists-2 s x φ ImplicitThereExists-1 introduceBiconditionalFromImplications

H       makeSubstExplicit

applyBiconditionalTransitivity )) </jh>

Export
Having proved everything in Interface:Intuitionistic first-order logic, we export to it. <jh> export (RESULT Interface:Intuitionistic_first-order_logic (PROPOSITIONAL) ) </jh>