Last active
May 4, 2023 08:11
-
-
Save kuribas/2b78285169d8d93850fc704c835c4537 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
import Data.List | |
infixr 1 =~ | |
infixr 1 >~ | |
infixr 1 =~< | |
(=~) : (a:k) -> {b:k} -> (a = b) -> (a = b) | |
(=~) _ prf = prf | |
qed : {a:k} -> (a = a) | |
qed = Refl | |
(=~<) : (a:k) -> {b:k} -> (a = b) -> (a = b) | |
(=~<) _ prf = prf | |
(>~) : {a:k} -> {b:k} -> {c:k} -> (a = b) -> (b = c) -> (a = c) | |
(>~) x y = trans x y | |
length_append : (l:List a) -> (r:List a) -> length (l ++ r) = (length l + length r) | |
length_append [] r = | |
length ([] ++ r) | |
=~ | |
0 + length r | |
=~ | |
qed | |
length_append (x :: xs) r = | |
length (x :: xs ++ r) | |
=~ | |
S (length (xs ++ r)) | |
=~< cong S (length_append xs r) >~ | |
S (length xs + length r) | |
=~ | |
qed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment