Rename order transitivity (#62)

This commit is contained in:
Patrick Stevens
2019-11-02 19:05:52 +00:00
committed by GitHub
parent 763ddb8dbb
commit 1325236359
20 changed files with 220 additions and 220 deletions

View File

@@ -138,7 +138,7 @@ module Numbers.BinaryNaturals.Subtraction where
subLemma2 : (a b : ) a <N b 2 *N a <N succ (2 *N b)
subLemma2 a b a<b with TotalOrder.totality TotalOrder (2 *N a) (succ (2 *N b))
subLemma2 a b a<b | inl (inl x) = x
subLemma2 a b a<b | inl (inr x) = exFalso (TotalOrder.irreflexive TotalOrder (TotalOrder.transitive TotalOrder x (TotalOrder.transitive TotalOrder (lessRespectsMultiplicationLeft a b 2 a<b (le 1 refl)) (le 0 refl))))
subLemma2 a b a<b | inl (inr x) = exFalso (TotalOrder.irreflexive TotalOrder (TotalOrder.<Transitive TotalOrder x (TotalOrder.<Transitive TotalOrder (lessRespectsMultiplicationLeft a b 2 a<b (le 1 refl)) (le 0 refl))))
subLemma2 a b a<b | inr x = exFalso (parity b a (equalityCommutative x))
subtraction : (a b : BinNat) a -B b no binNatToN a <N binNatToN b
@@ -457,7 +457,7 @@ module Numbers.BinaryNaturals.Subtraction where
subtraction2'' a b pr with -N pr
subtraction2'' a b pr | record { result = result ; pr = subPr } with inspect (go zero (NToBinNat a) (NToBinNat b))
subtraction2'' a b (inl pr) | record { result = result ; pr = subPr } | no with pr2 with subtraction (NToBinNat a) (NToBinNat b) pr2
... | bl rewrite nToN a | nToN b = exFalso (TotalOrder.irreflexive TotalOrder (TotalOrder.transitive TotalOrder pr bl))
... | bl rewrite nToN a | nToN b = exFalso (TotalOrder.irreflexive TotalOrder (TotalOrder.<Transitive TotalOrder pr bl))
subtraction2'' a b (inr pr) | record { result = result ; pr = subPr } | no with pr2 with subtraction (NToBinNat a) (NToBinNat b) pr2
... | bl rewrite nToN a | nToN b | pr = exFalso (TotalOrder.irreflexive TotalOrder bl)
subtraction2'' a b pr | record { result = result ; pr = subPr } | yes x with pr2 with subtraction2 a b pr2