First-order linear order defined via strict inequality

Here we prove Interface:First-order linear order, starting from Interface:First-order linear order defined via strict inequality.

Import
 import (PROPOSITIONAL Interface:Classical_propositional_calculus ) import (FIRSTORDER Interface:First-order_logic_with_quantifiability (PROPOSITIONAL) ) import (DEFINED Interface:First-order_linear_order_defined_via_strict_inequality (PROPOSITIONAL FIRSTORDER) ) 

Less than
We have been provided with a predicate  and a few basic properties. Here are some consequences of that.

 var (object a b c a0 b0 a1 b1) 

Builders
Here are some convenience builders for less-than.  thm (LessThanBuilderLL  ((b0 = b1) → ((a < b0) ↔ (a < b1))) ( a EqualityReflexivity a a b0 b1 LessThanBuilder detach1of2 ))

thm (LessThanBuilderRR  ((a0 = a1) → ((a0 < b) ↔ (a1 < b))) ( b EqualityReflexivity a0 a1 b b LessThanBuilder detach2of2 ))

thm (buildLessThan ((HA (a0 = a1)) (HB (b0 = b1))) ((a0 < b0) ↔ (a1 < b1)) ( HA       HB        introduceConjunction a0 a1 b0 b1 LessThanBuilder applyModusPonens ))

thm (buildLessThanLL ((HB (b0 = b1))) ((a < b0) ↔ (a < b1)) ( HB       b0 b1 a LessThanBuilderLL applyModusPonens ))

thm (buildLessThanRR ((HA (a0 = a1))) ((a0 < b) ↔ (a1 < b)) ( HA       a0 a1 b LessThanBuilderRR applyModusPonens )) 

Less than and equality
 thm (LessThanEquality  ((a < b) → (a ≠ b)) (  We'll put  on the proof stack for later.  a LessThanIrreflexivity  We start with a substitution:.  a b a LessThanBuilderLL  Adding negation to the consequent and detaching  we get , which is a transposition away from what we need.  addNegationInConsequent detachImplicationBiconditional transposeWithNegatedConsequent )) 

Nonstrict order
Here we define, as well as   and.  def ((≤ a b) ((a < b) ∨ (a = b))) def ((> b a) (a < b)) def ((≥ b a) (a ≤ b)) 

We next prove. The forward implication is easy, because  implies   and also.  thm (LessThanLessEqualForward  ((a < b) → ((a ≤ b) ∧ (a ≠ b))) ( (a < b) (a = b) DisjunctionRightIntroduction a b LessThanEquality composeConjunction )) </jh>

The reverse direction starts by taking.  thm (LessThanLessEqualReverse  (((a ≤ b) ∧ (a ≠ b)) → (a < b)) ( (a < b) (a = b) DisjunctionCommutativity eliminateBiconditionalReverse

(a = b) (a < b) DisjunctionImplication eliminateBiconditionalReverse applySyllogism </jh> That gives us, so importing we are done.  import ))

thm (LessThanLessEqual  ((a < b) ↔ ((a ≤ b) ∧ (a ≠ b))) ( a b LessThanLessEqualForward a b LessThanLessEqualReverse introduceBiconditionalFromImplications )) </jh>

For parallelism, we also provide the definition of  as a theorem.  thm (LessEqualLessThan  ((a ≤ b) ↔ ((a < b) ∨ (a = b))) ( (a ≤ b) BiconditionalReflexivity )) </jh>

Nonstrict order totality
We need to prove that  or. Expanding the definition of, that is  , which will follow readily from.  thm (LessEqualTotality  ((a ≤ b) ∨ (b ≤ a)) ( a b LessThanTotality swap23ofDisjunction3 </jh> We now have  so the next step is turning   into.  (a = b) DisjunctionIdempotence

a b EqualitySymmetry (a = b) buildDisjunctionLL applyBiconditionalTransitivity

transformDisjunctionRight </jh> We are almost done. We're just one step away from, which is what we need.  swap23ofDisjunction4 )) </jh>

Reflexivity
Reflexivity follows from totality:  thm (LessEqualReflexivity  (a ≤ a) ( a a LessEqualTotality conflateDisjunction )) </jh>

Builders
The builder for nonstrict inequality follows from the ones for equality and strict inequality.  thm (LessEqualBuilder  (((a0 = a1) ∧ (b0 = b1)) → ((a0 ≤ b0) ↔ (a1 ≤ b1))) ( a0 a1 b0 b1 LessThanBuilder

a0 a1 b0 b1 EqualityBuilder

buildDisjunctionInConsequent )) </jh>

Here are a few builders which are consequences of the one we have.  thm (LessEqualBuilderLL  ((b0 = b1) → ((a ≤ b0) ↔ (a ≤ b1))) ( a EqualityReflexivity a a b0 b1 LessEqualBuilder detach1of2 ))

thm (LessEqualBuilderRR  ((a0 = a1) → ((a0 ≤ b) ↔ (a1 ≤ b))) ( b EqualityReflexivity a0 a1 b b LessEqualBuilder detach2of2 )) </jh>

Here are rule forms of those builders.  thm (buildLessEqual ((HA (a0 = a1)) (HB (b0 = b1))) ((a0 ≤ b0) ↔ (a1 ≤ b1)) ( HA       HB        introduceConjunction a0 a1 b0 b1 LessEqualBuilder applyModusPonens ))

thm (buildLessEqualRR ((H (a0 = a1))) ((a0 ≤ b) ↔ (a1 ≤ b)) ( H       a0 a1 b LessEqualBuilderRR applyModusPonens ))

thm (buildLessEqualLL ((H (b0 = b1))) ((a ≤ b0) ↔ (a ≤ b1)) ( H       b0 b1 a LessEqualBuilderLL applyModusPonens )) </jh>

Equality implies.  thm (EqualityLessEqual  ((a = b) → (a ≤ b)) ( a LessEqualReflexivity

a b a LessEqualBuilderLL </jh> The builder gives us. But  is a theorem, so we are done.  detachImplicationBiconditional )) </jh>

Less than and less equal
 thm (LessThanLessEqualImplication  ((a < b) → (a ≤ b)) ( (a < b) (a = b) DisjunctionRightIntroduction )) </jh>

Transitivity
We start by proving that.

 thm (LessEqualLessThanTransitivity  (((a ≤ b) ∧ (b < c)) → (a < c)) ( (a < b) (a = b) (b < c) ConjunctionRightDistribution eliminateBiconditionalReverse

</jh> The first part of this proof is.  a b c LessThanTransitivity </jh> The other part is. <jh> a b c LessThanBuilderRR eliminateBiconditionalForwardInConsequent import </jh> Combining those two parts we are done. <jh> composeDisjunction applySyllogism )) </jh>

The proof for transitivity for nonstrict inequality,, is similar. <jh> thm (LessEqualTransitivity  (((a ≤ b) ∧ (b ≤ c)) → (a ≤ c)) ( (a ≤ b) (b < c) (b = c) ConjunctionLeftDistribution eliminateBiconditionalReverse </jh> The first part of this proof is. <jh> a b c LessEqualLessThanTransitivity (a < c) (a = c) DisjunctionRightIntroduction applySyllogism </jh> The second part of the proof is. <jh> b c a LessEqualBuilderLL eliminateBiconditionalReverseInConsequent applyComm import </jh> Combining the two parts we are done. <jh> composeDisjunction applySyllogism )) </jh>

The following theorems imply that no more than one of,  , or   holds. <jh> thm (LessThanGreaterThan  ((a < b) → (¬ (a > b))) ( a EqualityReflexivity

</jh> We start with. <jh> a b a LessThanTransitivity </jh> Using the previous theorem we turn this into. <jh> a a LessThanEquality applySyllogism

</jh> Since  is a theorem, this gives us  <jh> transposeWithNegatedConsequent applyModusPonens </jh> A bit of propositional logic turns this into what we need. <jh> distributeNegationPCP convertToImplicationFromDisjunction ))

thm (EqualityLessThan  ((a = b) → (¬ (a < b))) ( a b LessThanEquality transposeWithNegatedConsequent )) </jh>

Antisymmetry
<jh> thm (LessEqualAntisymmetryLemma  (((a < b) ∧ (b ≤ a)) → (a = b)) ( (a < b) (b < a) (b = a) ConjunctionLeftDistribution eliminateBiconditionalReverse </jh> The first half is. This holds trivially because  is a contradiction. <jh> a b LessThanGreaterThan

(a < b) (¬ (b < a)) ImplicationDisjunction eliminateBiconditionalReverse applyModusPonens

(a < b) (b < a) DeMorganPCP eliminateBiconditionalForward applyModusPonens

(¬ (a = b)) introduceAntecedent

eliminateTransposition </jh> The second half is, which of course is just rearranging. <jh> (a < b) (b = a) ConjunctionLeftElimination swapEqualityInConsequent </jh> Combining the two halves we are done. <jh> composeDisjunction applySyllogism ))

thm (LessEqualAntisymmetry  (((a ≤ b) ∧ (b ≤ a)) → (a = b)) ( (a < b) (a = b) (b ≤ a) ConjunctionRightDistribution eliminateBiconditionalReverse </jh> The first half is, which is the lemma we already proved. <jh> a b LessEqualAntisymmetryLemma </jh> The second half is a = b ∧ b ≤ a → a = b. <jh> (a = b) (b ≤ a) ConjunctionRightElimination </jh> Combining the halves we are done. <jh> composeDisjunction applySyllogism )) </jh>

Export
We first export an interface which contains everything we handle here, including the import from Interface:First-order linear order defined via nonstrict inequality. <jh> export (COMPLETE Interface:First-order_linear_order (PROPOSITIONAL FIRSTORDER) ) </jh>

It will also be helpful to export an interface which does not duplicate the declarations in Interface:First-order linear order defined via nonstrict inequality, for use in a module which has already exported the latter. <jh> export (ADDITIONAL Interface:First-order_linear_order_from_nonstrict_inequality (PROPOSITIONAL FIRSTORDER DEFINED) ) </jh>