Skip to content

Add (Is)DecPreorder to Relation.Binary.* #2488

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 5 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ Additions to existing modules
_≡?_ : DecidableEquality (Vec A n)
```

* In `Relation.Binary.Bundles`:
```agda
record DecPreorder c ℓ₁ ℓ₂ : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂))
```

* In `Relation.Binary.Construct.Interior.Symmetric`:
```agda
decidable : Decidable R → Decidable (SymInterior R)
Expand All @@ -281,6 +286,15 @@ Additions to existing modules
decPoset : Decidable R → DecPoset _ _ _
```

* In `Relation.Binary.Structures`:
```agda
record IsDecPreorder (_≲_ : Rel A ℓ₂) : Set (a ⊔ ℓ ⊔ ℓ₂) where
field
isPreorder : IsPreorder _≲_
_≟_ : Decidable _≈_
_≲?_ : Decidable _≲_
```

* In `Relation.Nullary.Decidable`:
```agda
does-⇔ : A ⇔ B → (a? : Dec A) → (b? : Dec B) → does a? ≡ does b?
Expand Down
20 changes: 20 additions & 0 deletions src/Relation/Binary/Bundles.agda
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@ record TotalPreorder c ℓ₁ ℓ₂ : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
open Preorder preorder public
hiding (Carrier; _≈_; _≲_; isPreorder)


record DecPreorder c ℓ₁ ℓ₂ : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
field
Carrier : Set c
_≈_ : Rel Carrier ℓ₁ -- The underlying equality.
_≲_ : Rel Carrier ℓ₂ -- The relation.
isDecPreorder : IsDecPreorder _≈_ _≲_

open IsDecPreorder isDecPreorder public
using (_≲?_; isPreorder)

preorder : Preorder c ℓ₁ ℓ₂
preorder = record
{ isPreorder = isPreorder
}

open Preorder preorder public
hiding (Carrier; _≈_; _≲_; isPreorder)


------------------------------------------------------------------------
-- Partial orders
------------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions src/Relation/Binary/Structures.agda
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ record IsTotalPreorder (_≲_ : Rel A ℓ₂) : Set (a ⊔ ℓ ⊔ ℓ₂) where
open IsPreorder isPreorder public


record IsDecPreorder (_≲_ : Rel A ℓ₂) : Set (a ⊔ ℓ ⊔ ℓ₂) where
field
isPreorder : IsPreorder _≲_
_≟_ : Decidable _≈_
_≲?_ : Decidable _≲_

open IsPreorder isPreorder public
hiding (module Eq)

module Eq where

isDecEquivalence : IsDecEquivalence
isDecEquivalence = record
{ isEquivalence = isEquivalence
; _≟_ = _≟_
}

open IsDecEquivalence isDecEquivalence public


------------------------------------------------------------------------
-- Partial orders
------------------------------------------------------------------------
Expand Down