| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Indexed binary relations |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
-- The contents of this module should be accessed via |
| 8 |
-- `Relation.Binary.Indexed.Heterogeneous`. |
| 9 |
|
| 10 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 11 |
|
| 12 |
module Relation.Binary.Indexed.Heterogeneous.Core where |
| 13 |
|
| 14 |
open import Level using (Level) |
| 15 |
import Relation.Binary.Core as B using (Rel; REL; _⇒_) |
| 16 |
|
| 17 |
------------------------------------------------------------------------ |
| 18 |
-- Indexed binary relations |
| 19 |
|
| 20 |
-- Heterogeneous types |
| 21 |
|
| 22 |
IREL : ∀ {i₁ i₂ a₁ a₂} {I₁ : Set i₁} {I₂ : Set i₂} → |
| 23 |
(I₁ → Set a₁) → (I₂ → Set a₂) → (ℓ : Level) → Set _ |
| 24 |
IREL A₁ A₂ ℓ = ∀ {i₁ i₂} → A₁ i₁ → A₂ i₂ → Set ℓ |
| 25 |
|
| 26 |
-- Homogeneous types |
| 27 |
|
| 28 |
IRel : ∀ {i a} {I : Set i} → (I → Set a) → (ℓ : Level) → Set _ |
| 29 |
IRel A ℓ = IREL A A ℓ |
| 30 |
|
| 31 |
------------------------------------------------------------------------ |
| 32 |
-- Generalised implication. |
| 33 |
|
| 34 |
infixr 4 _=[_]⇒_ |
| 35 |
|
| 36 |
_=[_]⇒_ : ∀ {a b ℓ₁ ℓ₂} {A : Set a} {B : A → Set b} → |
| 37 |
B.Rel A ℓ₁ → ((x : A) → B x) → IRel B ℓ₂ → Set _ |
| 38 |
P =[ f ]⇒ Q = ∀ {i j} → P i j → Q (f i) (f j) |