Last active
August 29, 2015 14:11
-
-
Save mathink/cac3f31e29f1789b0a5f to your computer and use it in GitHub Desktop.
Theorem Prover Advent Calendar day 15.
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
Set Implicit Arguments. | |
Unset Strict Implicit. | |
Require Import setoid_advent_2014. | |
Structure Map (X Y: Setoid) := | |
{ | |
map_body:> X -> Y; | |
prf_Map:> Proper ((==) ==> (==)) map_body | |
}. | |
Existing Instance prf_Map. | |
Notation makeMap f := (@Build_Map _ _ f _). | |
Notation "[ x .. y :-> p ]" := | |
(makeMap (fun x => .. (makeMap (fun y => p)) ..)) | |
(at level 200, x binder, y binder, right associativity, | |
format "'[' [ x .. y :-> '/ ' p ] ']'"). | |
Program Definition eq_Map | |
(A B: Type)(f: A -> B): Map (eq_Setoid A) (eq_Setoid B) := | |
[ x :-> f x ]. | |
Definition fun_Map | |
{X Y Z W: Type}(F: (X -> Y) -> (Z -> W)) | |
: Map (fun_Setoid X Y) (fun_Setoid Z W). | |
refine ([ f :-> F f ]). | |
unfold Proper, respectful; simpl. | |
intros f g Heq z. | |
Abort. | |
Definition const {A B: Type}(a: A): forall _: B, A := fun _ => a. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment