aboutsummaryrefslogtreecommitdiff
path: root/src/Util/HList.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2016-11-17 17:35:21 -0500
committerGravatar Jason Gross <jgross@mit.edu>2016-11-17 17:35:21 -0500
commit4b1fb93975a54c343c6ede50aeed3f2dccc6f14a (patch)
tree4bb36e786763a871b743e395be251f01d165fa1f /src/Util/HList.v
parentab3b7e409b93e367d46961b697da47e81ee64806 (diff)
Add HList.mapt_Proper
Diffstat (limited to 'src/Util/HList.v')
-rw-r--r--src/Util/HList.v11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Util/HList.v b/src/Util/HList.v
index cac84ece2..802ab1ed3 100644
--- a/src/Util/HList.v
+++ b/src/Util/HList.v
@@ -117,6 +117,17 @@ Proof.
destruct n; [ simpl; tauto | apply fold_right_and_True_hlist' ].
Qed.
+Global Instance mapt_Proper {n A F B}
+ : Proper
+ ((forall_relation (fun x => pointwise_relation _ Logic.eq))
+ ==> forall_relation (fun ts => Logic.eq ==> Logic.eq))
+ (@HList.mapt n A F B).
+Proof.
+ unfold forall_relation, pointwise_relation, respectful.
+ repeat intro; subst; destruct n as [|n]; [ reflexivity | ].
+ induction n; simpl in *; congruence.
+Qed.
+
Module Tuple.
Lemma map_id_ext {n A} (f : A -> A) (xs:tuple A n)
: hlist (fun x => f x = x) xs -> Tuple.map f xs = xs.