First-order linear order defined via nonstrict inequality

Here we prove Interface:First-order linear order, starting from Interface:First-order linear order defined via nonstrict 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_nonstrict_inequality (PROPOSITIONAL FIRSTORDER) ) 

Consequences
Here we prove various consequences of the order properties.

 var (object a b c a0 b0 a1 b1) 

Reflexivity follows from totality:  thm (LessEqualReflexivity  (a ≤ a) ( a a LessEqualTotality conflateDisjunction )) 

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 )) 

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 )) 

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

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

Strict 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  (finally justifying the informal name "less than or equal to" for  ). The proof is fairly straightforward expansion of the definition and rearrangement, but it will be easier to break out part of the proof into a lemma.  thm (LessEqualLessThanLemma  ((a ≤ b) ↔ (((a ≤ b) ∨ (a = b)) ∧ ((a ≠ b) ∨ (a = b)))) ( </jh> We start with the forward implication. The first half is  (a ≤ b) (a = b) DisjunctionRightIntroduction </jh> The second half is  (a = b) TertiumNonDatur swapDisjunction (a ≤ b) introduceAntecedent </jh> Combining these gives us the forward implication.  composeConjunction </jh> Moving on to the reverse implication, we start with  ((a ≤ b) ∨ (a = b)) ((a ≠ b) ∨ (a = b)) ConjunctionRightElimination </jh> Then we show.  (a ≤ b) ImplicationReflexivity a b EqualityLessEqual composeDisjunction </jh> Combining these gives the reverse implication,  applySyllogism </jh> and combining forward and reverse implications completes the proof.  introduceBiconditionalFromImplications ))

thm (LessEqualLessThan  ((a ≤ b) ↔ ((a < b) ∨ (a = b))) ( a b LessEqualLessThanLemma

(a ≤ b) (a ≠ b) (a = b) DisjunctionRightDistribution swapBiconditional applyBiconditionalTransitivity </jh> That gives us. But  is just the definition of , so this is enough.  )) </jh>

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

The builder for  is a consequence of the one for.

 thm (LessThanBuilder  (((a0 = a1) ∧ (b0 = b1)) → ((a0 < b0) ↔ (a1 < b1))) ( a0 a1 b0 b1 LessEqualBuilder

a0 a1 b0 b1 EqualityBuilder addNegationInConsequent

buildConjunctionInConsequent ))

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 )) </jh>

Transitivity
We start by proving that. This has transitivity for  as an immediate consequence, but will occasionally be useful in its own right.

The first lemma constitutes the easy part of the proof.  thm (LessEqualLessThanTransitivity-1  (((a ≤ b) ∧ (b < c)) → (a ≤ c)) ( (b ≤ c) (b ≠ c) ConjunctionRightElimination (a ≤ b) conjoinLL

a b c LessEqualTransitivity applySyllogism )) </jh>

The harder part of the proof is that. This is fairly easy to sketch out: suppose that  and that. Applying  to the first formula gives , and thus   by antisymmetry. But  and   imply , and this contradicts. Here is one way to formalize that argument.  thm (LessEqualLessThanTransitivity-2  (((a ≤ b) ∧ (b < c)) → (a ≠ c)) ( </jh> We start with a substitution,  a c b LessThanBuilderLL (a ≤ b) buildConjunctionLLInConsequent </jh> Taking the reverse direction of the biconditional, expanding the definition of  and assocating the conjunctions gives  eliminateBiconditionalForwardInConsequent

(a ≤ b) (b ≤ a) (b ≠ a) ConjunctionAssociativity swapBiconditional transformImplicationImplicationConsequent </jh> But  implies  ,  a b LessEqualAntisymmetry

a b EqualitySymmetry eliminateBiconditionalReverse applySyllogism </jh> so  implies   (false). <jh> (b ≠ a) conjoinRR

(b = a) Contradiction eliminateBiconditionalReverse applySyllogism </jh> The next step is. <jh> ((a ≤ b) ∧ (b < c)) addCommonAntecedent

((a ≤ b) ∧ (b < c)) NegationImplication eliminateBiconditionalForward applySyllogism </jh> Combining that with the previous result gives. <jh> applySyllogism </jh> And a transposition finishes the job. <jh> transposeWithNegatedConsequent )) </jh>

Combining the two lemmas gives us transitivity for. <jh> thm (LessEqualLessThanTransitivity  (((a ≤ b) ∧ (b < c)) → (a < c)) ( a b c LessEqualLessThanTransitivity-1 a b c LessEqualLessThanTransitivity-2 composeConjunction )) </jh>

Transitivity for  is an immediate consequence. <jh> thm (LessThanLessEqualImplication  ((a < b) → (a ≤ b)) ( (a ≤ b) (a ≠ b) ConjunctionRightElimination ))

thm (LessThanTransitivity  (((a < b) ∧ (b < c)) → (a < c)) ( a b LessThanLessEqualImplication

(b < c) conjoinRR

a b c LessEqualLessThanTransitivity applySyllogism )) </jh>

Strict order totality
Exactly one of,  , or   holds. We start with the proposition that at least one of the three holds. <jh> thm (LessThanTotality  (((a < b) ∨ (a = b)) ∨ (a > b)) ( </jh> The meat of the proof is. <jh> a b LessEqualTotality

a b LessEqualLessThan b a LessEqualLessThan buildDisjunction

eliminateBiconditionalReverse applyModusPonens </jh> We just need to do some rearranging to finish. <jh> swap23ofDisjunction4

b a EqualitySymmetry (a = b) buildDisjunctionLL

(a = b) DisjunctionIdempotence swapBiconditional applyBiconditionalTransitivity

transformDisjunctionRight

swap23ofDisjunction3 )) </jh>

The following theorems imply that no more than one of,  , or   holds. <jh> thm (LessThanEquality  ((a < b) → (a ≠ b)) ( a b LessThanLessEqual eliminateBiconditionalReverse

(a ≤ b) (a ≠ b) ConjunctionLeftElimination

applySyllogism ))

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>

Irreflexivity
<jh> thm (LessThanIrreflexivity  (¬ (a < a)) ( a EqualityReflexivity a a EqualityLessThan applyModusPonens )) </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>