-
Notifications
You must be signed in to change notification settings - Fork 257
[ add ] Relation.Binary.Properties.PartialSetoid
#2678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
------------------------------------------------------------------------ | ||
-- 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 | ||
jamesmckinna marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need to match on the proof here? Is this not just a variant of
subst
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh...
yes, probably!er, no, actually, as the arguments are in the wrong order, and introducing aflip
/≡.sym
seemed like an indirection too far!?