-
Notifications
You must be signed in to change notification settings - Fork 251
[ new ] symmetric core of a binary relation #2071
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d2d7b9f
[ new ] symmetric core of a binary relation
laMudri 9f0d928
[ fix ] name clashes
laMudri bc2b8fb
[ more ] respond to McKinna's comments
laMudri 5b8a0a0
[ rename ] fields to lhs≤rhs and rhs≤lhs
laMudri 0217f3c
[ more ] incorporate parts of McKinna's review
laMudri 03c8bd5
[ minor ] remove implicit argument application from transitive
laMudri 4f7eea6
[ edit ] pull out isEquivalence and do some renaming
laMudri 1e10ef6
[ minor ] respond to easy comments
laMudri 0aa58af
[ refactor ] remove IsProset, and move Proset to main hierarchy
laMudri 60bd7ad
Merge branch 'master' into sym-core
MatthewDaggitt dca69cc
Eliminate Proset
MatthewDaggitt 6d43ff9
Fixed CHANGELOG typo
MatthewDaggitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Symmetric interior of a binary relation | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Relation.Binary.Construct.Interior.Symmetric where | ||
|
||
open import Function.Base using (flip) | ||
open import Level | ||
open import Relation.Binary | ||
|
||
private | ||
variable | ||
a b c ℓ r s t : Level | ||
A : Set a | ||
R S T : Rel A r | ||
|
||
------------------------------------------------------------------------ | ||
-- Definition | ||
|
||
record SymInterior (R : Rel A ℓ) (x y : A) : Set ℓ where | ||
constructor _,_ | ||
field | ||
lhs≤rhs : R x y | ||
rhs≤lhs : R y x | ||
|
||
open SymInterior public | ||
|
||
------------------------------------------------------------------------ | ||
-- Properties | ||
|
||
-- The symmetric interior is symmetric. | ||
symmetric : Symmetric (SymInterior R) | ||
symmetric (r , r′) = r′ , r | ||
|
||
-- The symmetric interior of R is greater than (or equal to) any other symmetric | ||
-- relation contained by R. | ||
unfold : Symmetric S → S ⇒ R → S ⇒ SymInterior R | ||
unfold sym f s = f s , f (sym s) | ||
MatthewDaggitt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
-- SymInterior preserves various properties. | ||
reflexive : Reflexive R → Reflexive (SymInterior R) | ||
reflexive refl = refl , refl | ||
|
||
trans : Trans R S T → Trans S R T → | ||
Trans (SymInterior R) (SymInterior S) (SymInterior T) | ||
trans trans-rs trans-sr (r , r′) (s , s′) = trans-rs r s , trans-sr s′ r′ | ||
|
||
transitive : Transitive R → Transitive (SymInterior R) | ||
transitive tr = trans tr tr | ||
|
||
-- The symmetric interior of a strict relation is empty. | ||
asymmetric⇒empty : Asymmetric R → Empty (SymInterior R) | ||
asymmetric⇒empty asym (r , r′) = asym r r′ | ||
|
||
-- A reflexive transitive relation _≤_ gives rise to a poset in which the | ||
-- equivalence relation is SymInterior _≤_. | ||
|
||
isEquivalence : Reflexive R → Transitive R → IsEquivalence (SymInterior R) | ||
isEquivalence refl trans = record | ||
{ refl = reflexive refl | ||
; sym = symmetric | ||
; trans = transitive trans | ||
} | ||
|
||
isPartialOrder : Reflexive R → Transitive R → IsPartialOrder (SymInterior R) R | ||
isPartialOrder refl trans = record | ||
{ isPreorder = record | ||
{ isEquivalence = isEquivalence refl trans | ||
; reflexive = lhs≤rhs | ||
; trans = trans | ||
} | ||
; antisym = _,_ | ||
} | ||
|
||
poset : ∀ {a} {A : Set a} {R : Rel A ℓ} → Reflexive R → Transitive R → Poset a ℓ ℓ | ||
poset {R = R} refl trans = record | ||
{ _≤_ = R | ||
; isPartialOrder = isPartialOrder refl trans | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.