-
Notifications
You must be signed in to change notification settings - Fork 247
/
Copy pathPartialSetoid.agda
47 lines (32 loc) · 1.26 KB
/
PartialSetoid.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
------------------------------------------------------------------------
-- The Agda standard library
--
-- Additional properties for setoids
------------------------------------------------------------------------
{-# OPTIONS --cubical-compatible --safe #-}
open import Relation.Binary.Bundles using (PartialSetoid)
module Relation.Binary.Properties.PartialSetoid
{a ℓ} (S : PartialSetoid a ℓ) where
open import Data.Product.Base using (_,_; _×_)
open import Relation.Binary.Definitions using (LeftTrans; RightTrans)
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_)
open PartialSetoid S
private
variable
x y z : Carrier
------------------------------------------------------------------------
-- Proofs for partial equivalence relations
trans-reflˡ : LeftTrans _≡_ _≈_
trans-reflˡ ≡.refl p = p
trans-reflʳ : RightTrans _≈_ _≡_
trans-reflʳ p ≡.refl = p
p-reflˡ : x ≈ y → x ≈ x
p-reflˡ p = trans p (sym p)
p-reflʳ : x ≈ y → y ≈ y
p-reflʳ p = trans (sym p) p
p-refl : x ≈ y → x ≈ x × y ≈ y
p-refl p = p-reflˡ p , p-reflʳ p
p-reflexiveˡ : x ≈ y → x ≡ z → x ≈ z
p-reflexiveˡ p ≡.refl = p-reflˡ p
p-reflexiveʳ : x ≈ y → y ≡ z → y ≈ z
p-reflexiveʳ p ≡.refl = p-reflʳ p