Skip to content

Commit 4b3bb54

Browse files
authored
[ add ] Relation.Binary.Properties.PartialSetoid (#2678)
* add: properties of PERs * use: `Relation.Binary.Definitions` * make prefix `partial-`
1 parent bcd91ec commit 4b3bb54

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ New modules
165165

166166
* `Data.Sign.Show` to show a sign
167167

168+
* `Relation.Binary.Properties.PartialSetoid` to systematise properties of a PER
169+
168170
Additions to existing modules
169171
-----------------------------
170172

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Additional properties for setoids
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
open import Relation.Binary.Bundles using (PartialSetoid)
10+
11+
module Relation.Binary.Properties.PartialSetoid
12+
{a ℓ} (S : PartialSetoid a ℓ) where
13+
14+
open import Data.Product.Base using (_,_; _×_)
15+
open import Relation.Binary.Definitions using (LeftTrans; RightTrans)
16+
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_)
17+
18+
open PartialSetoid S
19+
20+
private
21+
variable
22+
x y z : Carrier
23+
24+
------------------------------------------------------------------------
25+
-- Proofs for partial equivalence relations
26+
27+
trans-reflˡ : LeftTrans _≡_ _≈_
28+
trans-reflˡ ≡.refl p = p
29+
30+
trans-reflʳ : RightTrans _≈_ _≡_
31+
trans-reflʳ p ≡.refl = p
32+
33+
partial-reflˡ : x ≈ y x ≈ x
34+
partial-reflˡ p = trans p (sym p)
35+
36+
partial-reflʳ : x ≈ y y ≈ y
37+
partial-reflʳ p = trans (sym p) p
38+
39+
partial-refl : x ≈ y x ≈ x × y ≈ y
40+
partial-refl p = partial-reflˡ p , partial-reflʳ p
41+
42+
partial-reflexiveˡ : x ≈ y x ≡ z x ≈ z
43+
partial-reflexiveˡ p ≡.refl = partial-reflˡ p
44+
45+
partial-reflexiveʳ : x ≈ y y ≡ z y ≈ z
46+
partial-reflexiveʳ p ≡.refl = partial-reflʳ p
47+

0 commit comments

Comments
 (0)