Created
November 6, 2017 15:24
-
-
Save clayrat/ca9809dbd1990c0475fac67f6bb923e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| leLtOrEq : (x, y : Bin) -> x `Le` y -> Either (x `Lt` y) (x=y) | |
| leLtOrEq x y xley with (x `compare` y) proof xy | |
| | LT = Left Refl | |
| | EQ = Right $ compareEqIffTo x y (sym xy) | |
| | GT = absurd $ xley Refl | |
| ltTrans : (p, q, r : Bin) -> p `Lt` q -> q `Lt` r -> p `Lt` r | |
| ltTrans p q r = | |
| peanoRect | |
| (\x => (s, t : Bin) -> s `Lt` t -> t `Lt` x -> s `Lt` x) | |
| base | |
| (\x,prf,s,t,sltt,tltsx => | |
| case leLtOrEq t x $ ltSuccRTo t x tltsx of | |
| Left tltx => | |
| ltSuccRFro s x $ | |
| ltLeIncl s x $ | |
| prf s t sltt tltx | |
| Right teqx => | |
| rewrite sym teqx in | |
| ltSuccRFro s t $ | |
| ltLeIncl s t sltt | |
| ) | |
| r p q | |
| where | |
| base : (n, m : Bin) -> n `Lt` m -> m `Lt` 0 -> n `Lt` 0 | |
| base _ BinO _ mltz = absurd mltz | |
| base _ (BinP _) _ mltz = absurd mltz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment