aboutsummaryrefslogtreecommitdiff
path: root/src/Util
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2018-11-16 22:06:53 -0500
committerGravatar Jason Gross <jgross@mit.edu>2018-11-16 22:07:30 -0500
commite294cfbd559677f6ffe219d96158373e886f3615 (patch)
tree6c16b148bcc3d91503fa13b8b9c08063d8bd2987 /src/Util
parent5b41397593f219d4c478ba1d629359d9455a4550 (diff)
Add related_sigT_by_eq
Diffstat (limited to 'src/Util')
-rw-r--r--src/Util/Sigma/Related.v16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Util/Sigma/Related.v b/src/Util/Sigma/Related.v
new file mode 100644
index 000000000..ac98f7629
--- /dev/null
+++ b/src/Util/Sigma/Related.v
@@ -0,0 +1,16 @@
+Import EqNotations.
+
+Definition related_sigT_by_eq {A P1 P2} (R : forall x : A, P1 x -> P2 x -> Prop)
+ (x : @sigT A P1) (y : @sigT A P2)
+ : Prop
+ := { pf : projT1 x = projT1 y
+ | R _ (rew pf in projT2 x) (projT2 y) }.
+
+Definition map_related_sigT_by_eq {A P1 P2} {R1 R2 : forall x : A, P1 x -> P2 x -> Prop}
+ (HR : forall x v1 v2, R1 x v1 v2 -> R2 x v1 v2)
+ (x : @sigT A P1) (y : @sigT A P2)
+ : @related_sigT_by_eq A P1 P2 R1 x y -> @related_sigT_by_eq A P1 P2 R2 x y.
+Proof using Type.
+ destruct x, y; cbv [related_sigT_by_eq projT1 projT2].
+ intro H; exists (proj1_sig H); apply HR, (proj2_sig H).
+Qed.