Created
August 18, 2014 12:51
-
-
Save edwinb/3e940ccef4fb4e1aa469 to your computer and use it in GitHub Desktop.
A simple coinductive proof
This file contains 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
ones : Num a => Stream a | |
ones = 1 :: ones | |
twos : Num a => Stream a | |
twos = 2 :: twos | |
codata EqStream : Stream a -> Stream a -> Type where | |
ReflStream : x = y -> EqStream xs ys -> EqStream (x :: xs) (y :: ys) | |
-- can't do it for all Num since we don't know how * behaves! | |
p : EqStream (map (*2) (ones {a=Int})) twos | |
p = ReflStream refl p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment