| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Homogeneously-indexed binary relations |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
-- The contents of this module should be accessed via |
| 8 |
-- `Relation.Binary.Indexed.Homogeneous`. |
| 9 |
|
| 10 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 11 |
|
| 12 |
module Relation.Binary.Indexed.Homogeneous.Definitions where |
| 13 |
|
| 14 |
open import Data.Product.Base using (_×_) |
| 15 |
open import Level using (Level) |
| 16 |
open import Relation.Binary.Core using (_⇒_) |
| 17 |
import Relation.Binary.Definitions as B |
| 18 |
using (Reflexive; Symmetric; Transitive; Antisymmetric; Decidable) |
| 19 |
open import Relation.Binary.Indexed.Homogeneous.Core using (IRel) |
| 20 |
open import Relation.Unary.Indexed using (IPred) |
| 21 |
|
| 22 |
private |
| 23 |
variable |
| 24 |
i a ℓ ℓ₁ ℓ₂ : Level |
| 25 |
I : Set i |
| 26 |
|
| 27 |
------------------------------------------------------------------------ |
| 28 |
-- Definitions |
| 29 |
|
| 30 |
module _ (A : I → Set a) where |
| 31 |
|
| 32 |
syntax Implies A _∼₁_ _∼₂_ = _∼₁_ ⇒[ A ] _∼₂_ |
| 33 |
|
| 34 |
Implies : IRel A ℓ₁ → IRel A ℓ₂ → Set _ |
| 35 |
Implies _∼₁_ _∼₂_ = ∀ {i} → _∼₁_ ⇒ (_∼₂_ {i}) |
| 36 |
|
| 37 |
Reflexive : IRel A ℓ → Set _ |
| 38 |
Reflexive _∼_ = ∀ {i} → B.Reflexive (_∼_ {i}) |
| 39 |
|
| 40 |
Symmetric : IRel A ℓ → Set _ |
| 41 |
Symmetric _∼_ = ∀ {i} → B.Symmetric (_∼_ {i}) |
| 42 |
|
| 43 |
Transitive : IRel A ℓ → Set _ |
| 44 |
Transitive _∼_ = ∀ {i} → B.Transitive (_∼_ {i}) |
| 45 |
|
| 46 |
Antisymmetric : IRel A ℓ₁ → IRel A ℓ₂ → Set _ |
| 47 |
Antisymmetric _≈_ _∼_ = ∀ {i} → B.Antisymmetric _≈_ (_∼_ {i}) |
| 48 |
|
| 49 |
Decidable : IRel A ℓ → Set _ |
| 50 |
Decidable _∼_ = ∀ {i} → B.Decidable (_∼_ {i}) |
| 51 |
|
| 52 |
Respects : IPred A ℓ₁ → IRel A ℓ₂ → Set _ |
| 53 |
Respects P _∼_ = ∀ {i} {x y : A i} → x ∼ y → P x → P y |
| 54 |
|
| 55 |
Respectsˡ : IRel A ℓ₁ → IRel A ℓ₂ → Set _ |
| 56 |
Respectsˡ P _∼_ = ∀ {i} {x y z : A i} → x ∼ y → P x z → P y z |
| 57 |
|
| 58 |
Respectsʳ : IRel A ℓ₁ → IRel A ℓ₂ → Set _ |
| 59 |
Respectsʳ P _∼_ = ∀ {i} {x y z : A i} → x ∼ y → P z x → P z y |
| 60 |
|
| 61 |
Respects₂ : IRel A ℓ₁ → IRel A ℓ₂ → Set _ |
| 62 |
Respects₂ P _∼_ = (Respectsʳ P _∼_) × (Respectsˡ P _∼_) |