forked from agda/agda-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointwise.agda
More file actions
35 lines (26 loc) · 1.25 KB
/
Pointwise.agda
File metadata and controls
35 lines (26 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
------------------------------------------------------------------------
-- The Agda standard library
--
-- Pointwise equality for containers
------------------------------------------------------------------------
{-# OPTIONS --cubical-compatible --safe #-}
module Data.Container.Relation.Binary.Pointwise where
open import Data.Product using (_,_; Σ-syntax; -,_; proj₁; proj₂)
open import Function
open import Level using (_⊔_)
open import Relation.Binary using (REL; _⇒_)
open import Relation.Binary.PropositionalEquality.Core as P
using (_≡_; subst; cong)
open import Data.Container.Core using (Container; ⟦_⟧)
-- Equality, parametrised on an underlying relation.
module _ {s p} (C : Container s p) where
record Pointwise {x y e} {X : Set x} {Y : Set y} (R : REL X Y e)
(cx : ⟦ C ⟧ X) (cy : ⟦ C ⟧ Y) : Set (s ⊔ p ⊔ e) where
constructor _,_
field shape : proj₁ cx ≡ proj₁ cy
position : ∀ p → R (proj₂ cx p) (proj₂ cy (subst _ shape p))
module _ {s p} {C : Container s p} {x y} {X : Set x} {Y : Set y}
{ℓ ℓ′} {R : REL X Y ℓ} {R′ : REL X Y ℓ′}
where
map : R ⇒ R′ → Pointwise C R ⇒ Pointwise C R′
map R⇒R′ (s , f) = s , R⇒R′ ∘ f