| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Pointwise equality for containers |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Container.Relation.Binary.Pointwise where |
| 10 |
|
| 11 |
open import Data.Product.Base using (_,_; Σ-syntax; -,_; proj₁; proj₂) |
| 12 |
open import Data.Container.Core using (Container; ⟦_⟧) |
| 13 |
open import Function.Base using (_∘_) |
| 14 |
open import Level using (_⊔_) |
| 15 |
open import Relation.Binary.Core using (REL; _⇒_) |
| 16 |
open import Relation.Binary.PropositionalEquality.Core using (_≡_; subst) |
| 17 |
|
| 18 |
-- Equality, parametrised on an underlying relation. |
| 19 |
|
| 20 |
module _ {s p} (C : Container s p) where |
| 21 |
|
| 22 |
record Pointwise {x y e} {X : Set x} {Y : Set y} (R : REL X Y e) |
| 23 |
(cx : ⟦ C ⟧ X) (cy : ⟦ C ⟧ Y) : Set (s ⊔ p ⊔ e) where |
| 24 |
constructor _,_ |
| 25 |
field shape : proj₁ cx ≡ proj₁ cy |
| 26 |
position : ∀ p → R (proj₂ cx p) (proj₂ cy (subst _ shape p)) |
| 27 |
infixr 4 _,_ |
| 28 |
|
| 29 |
module _ {s p} {C : Container s p} {x y} {X : Set x} {Y : Set y} |
| 30 |
{ℓ ℓ′} {R : REL X Y ℓ} {R′ : REL X Y ℓ′} |
| 31 |
where |
| 32 |
|
| 33 |
map : R ⇒ R′ → Pointwise C R ⇒ Pointwise C R′ |
| 34 |
map R⇒R′ (s , f) = s , R⇒R′ ∘ f |