diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-06 14:10:10 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2022-12-06 14:10:10 +0000 |
commit | 6fb52c637c67788e78bdd1e87a80443aa227d5d6 (patch) | |
tree | 0438e365cd3cacb0bb1a2d7605df42cc09c13234 | |
parent | 336c0c8c486bf5323cd44f35e06b3aa25f53bb22 (diff) |
Define bundle, index and reindex for morphisms.
-rw-r--r-- | src/Data/Setoid/Indexed/Definition.idr | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Data/Setoid/Indexed/Definition.idr b/src/Data/Setoid/Indexed/Definition.idr index cf5d9a2..59dd497 100644 --- a/src/Data/Setoid/Indexed/Definition.idr +++ b/src/Data/Setoid/Indexed/Definition.idr @@ -85,6 +85,19 @@ record (~>) {0 a : Type} (x, y : IndexedSetoid a) where H : (i : a) -> x.U i -> y.U i homomorphic : IndexedSetoidHomomorphism x y H +namespace Homomorphism + public export + bundle : ((i : a) -> index x i ~> index y i) -> x ~> y + bundle f = MkIndexedSetoidHomomorphism (\i => (f i).H) (\i => (f i).homomorphic) + + public export + index : x ~> y -> (i : a) -> index x i ~> index y i + index f i = MkSetoidHomomorphism (f.H i) (f.homomorphic i) + + public export + reindex : (f : a -> b) -> x ~> y -> reindex f x ~> reindex f y + reindex f g = bundle (\i => index g $ f i) + public export mate : {y : IndexedSetoid a} -> ((i : a) -> x i -> y.U i) -> irrelevantCast x ~> y mate f = MkIndexedSetoidHomomorphism |