{-# OPTIONS --cubical-compatible --safe #-}
module Relation.Binary.Indexed.Homogeneous.Core where
open import Level using (Level; _⊔_)
open import Data.Product.Base using (_×_)
open import Relation.Binary.Core as B using (REL; Rel)
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
import Relation.Binary.Indexed.Heterogeneous as I
open import Relation.Unary.Indexed using (IPred)
private
variable
a b c ℓ : Level
I : Set c
IREL : (I → Set a) → (I → Set b) → (ℓ : Level) → Set _
IREL A B ℓ = ∀ {i} → REL (A i) (B i) ℓ
IRel : (I → Set a) → (ℓ : Level) → Set _
IRel A = IREL A A
Lift : (A : I → Set a) → IRel A ℓ → Rel (∀ i → A i) _
Lift _ _∼_ x y = ∀ i → x i ∼ y i
module _ {i a b} {I : Set i} {A : I → Set a} {B : I → Set b} where
OverPath : ∀ {ℓ} → IREL A B ℓ → ∀ {i j} → i ≡ j → REL (A i) (B j) ℓ
OverPath _∼_ refl = _∼_
toHetIndexed : ∀ {ℓ} → IREL A B ℓ → I.IREL A B (i ⊔ ℓ)
toHetIndexed _∼_ {i} {j} x y = (p : i ≡ j) → OverPath _∼_ p x y
fromHetIndexed : ∀ {ℓ} → I.IREL A B ℓ → IREL A B ℓ
fromHetIndexed _∼_ = _∼_