summaryrefslogtreecommitdiff
path: root/src/Soat
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2022-11-25 15:31:29 +0000
committerGreg Brown <greg.brown01@ed.ac.uk>2022-11-25 15:31:29 +0000
commitfec727c164f9f3967eb543406d082f89fe61c052 (patch)
treec81578772c18489208e6c7675ae63187111a5321 /src/Soat
parenta7d205c7d156c81efb3590f30dce62939a9dd088 (diff)
Prove index property of shuffle.
Diffstat (limited to 'src/Soat')
-rw-r--r--src/Soat/Data/Sublist.idr6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Soat/Data/Sublist.idr b/src/Soat/Data/Sublist.idr
index 98e3c14..ec73723 100644
--- a/src/Soat/Data/Sublist.idr
+++ b/src/Soat/Data/Sublist.idr
@@ -68,3 +68,9 @@ public export
shuffle : is `Sublist` js -> x ^ js -> x ^ is
shuffle [] xs = []
shuffle (mem :: mems) xs = index xs mem :: shuffle mems xs
+
+public export
+indexShuffle : (f : is `Sublist` js) -> {0 xs : x ^ js} -> (elem : Elem i is)
+ -> index (shuffle f xs) elem = index xs (curry f elem)
+indexShuffle (mem :: mems) Here = Refl
+indexShuffle (mem :: mems) (There elem) = indexShuffle mems elem