diff options
author | Jason Gross <jgross@mit.edu> | 2017-11-09 16:25:36 -0500 |
---|---|---|
committer | Jason Gross <jgross@mit.edu> | 2017-11-09 16:25:36 -0500 |
commit | c45d3843e2a89547ee8949d5239696f6c6a1eb5d (patch) | |
tree | d5435d35336b8a565ba06b8c6b6a0d32bc321d6d /src/Util/Tuple.v | |
parent | 4d7b3d1ed5e8d894e4bb9c1502d8b4432cdbe7af (diff) |
Add more versions of fieldwise_Proper
Diffstat (limited to 'src/Util/Tuple.v')
-rw-r--r-- | src/Util/Tuple.v | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Util/Tuple.v b/src/Util/Tuple.v index b0904f09d..72feea5ea 100644 --- a/src/Util/Tuple.v +++ b/src/Util/Tuple.v @@ -1059,3 +1059,38 @@ Proof. destruct n; intros; [ | apply fieldwise'_Proper ]. compute; trivial. Qed. + +Global Instance fieldwise'_Proper_iff + : forall {n A B}, Proper (pointwise_relation _ (pointwise_relation _ iff) ==> eq ==> eq ==> iff) (@fieldwise' A B n) | 10. +Proof. + induction n as [|n IHn]; intros. + { compute; intros; subst; auto. } + { cbv [pointwise_relation Proper respectful] in *. + intros f g Hfg x y ? x' y' ?; subst y y'. + simpl; erewrite IHn by first [ eassumption | eauto ]. + rewrite Hfg; reflexivity. } +Qed. + +Global Instance fieldwise_Proper_iff + : forall {n A B}, Proper (pointwise_relation _ (pointwise_relation _ iff) ==> eq ==> eq ==> iff) (@fieldwise A B n) | 10. +Proof. + destruct n; intros; [ | apply fieldwise'_Proper_iff ]. + compute; tauto. +Qed. + +Global Instance fieldwise'_Proper_flip_impl + : forall {n A B}, Proper (pointwise_relation _ (pointwise_relation _ (flip impl)) ==> eq ==> eq ==> flip impl) (@fieldwise' A B n) | 10. +Proof. + induction n as [|n IHn]; intros. + { compute; intros; subst; auto. } + { cbv [pointwise_relation Proper respectful flip impl] in *. + intros f g Hfg x y ? x' y' ? H'; subst y y'. + simpl in *; destruct H'; eauto. } +Qed. + +Global Instance fieldwise_Proper_flip_impl + : forall {n A B}, Proper (pointwise_relation _ (pointwise_relation _ (flip impl)) ==> eq ==> eq ==> flip impl) (@fieldwise A B n) | 10. +Proof. + destruct n; intros; [ | apply fieldwise'_Proper_flip_impl ]. + compute; trivial. +Qed. |