diff options
author | Greg Brown <greg.brown01@ed.ac.uk> | 2022-11-29 14:57:29 +0000 |
---|---|---|
committer | Greg Brown <greg.brown01@ed.ac.uk> | 2022-11-29 14:57:29 +0000 |
commit | ce49914c213f798dd052229efe92633247fd4435 (patch) | |
tree | fd42f0573cbeb9f0b0ae3dec6a3492c48dc92025 /src/Soat | |
parent | d51d8381e9c4053f71a597f1a2ae7073eca5b693 (diff) |
Prove Pointwise forms a setoid.
Diffstat (limited to 'src/Soat')
-rw-r--r-- | src/Soat/Data/Product.idr | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Soat/Data/Product.idr b/src/Soat/Data/Product.idr index f392a2d..0cb5dda 100644 --- a/src/Soat/Data/Product.idr +++ b/src/Soat/Data/Product.idr @@ -192,6 +192,17 @@ namespace Pointwise pwTrans f [] [] = [] pwTrans f (r :: rs) (s :: ss) = transitive r s :: pwTrans f rs ss + public export + pwEquivalence : IEquivalence x rel -> {is : _} -> Setoid.Equivalence (x ^ is) (Pointwise rel) + pwEquivalence eq = MkEquivalence + (MkReflexive $ pwRefl (\i => (eq i).refl)) + (MkSymmetric $ pwSym (\i => (eq i).sym)) + (MkTransitive $ pwTrans (\i => (eq i).trans)) + + public export + pwSetoid : ISetoid a -> List a -> Setoid + pwSetoid x is = MkSetoid (x.U ^ is) _ (pwEquivalence x.equivalence) + -- Introductors and Eliminators public export |