Created
July 16, 2013 21:47
-
-
Save JasonGross/6015446 to your computer and use it in GitHub Desktop.
judgemental funext out of HITs
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
| Parameter A : Type. | |
| Parameter B : A -> Type. | |
| Parameters f g : forall a : A, B a. | |
| Axiom p : forall x, f x = g x. | |
| Inductive I := | |
| | zero : I | |
| | one : I | |
| | seg : zero = one. | |
| Definition funext0 (x : I) (a : A) := | |
| match x return B a with | |
| | zero => f a | |
| | one => g a | |
| | seg => p a | |
| end. | |
| Definition funext := funext0 seg. | |
| Check (funext0 seg : f = g). | |
| (* unfold [funext0] *) | |
| Check (((fun (x : I) (a : A) => | |
| match x return B a with | |
| | zero => f a | |
| | one => g a | |
| | seg => p a | |
| end) seg) : f = g). | |
| (* beta reduce *) | |
| Check ((fun a : A => | |
| match seg return B a with | |
| | zero => f a | |
| | one => g a | |
| | seg => p a | |
| end) : f = g). | |
| (* unfold the match *) | |
| Check ((fun a : A => p) : f = g). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment