| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Properties of pointwise equality for containers |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Container.Relation.Binary.Pointwise.Properties where |
| 10 |
|
| 11 |
open import Axiom.Extensionality.Propositional using (Extensionality) |
| 12 |
open import Data.Container.Core using (Container; ⟦_⟧) |
| 13 |
open import Data.Container.Relation.Binary.Pointwise |
| 14 |
using (Pointwise; _,_) |
| 15 |
open import Data.Product.Base using (_,_; Σ-syntax; -,_) |
| 16 |
open import Level using (_⊔_) |
| 17 |
open import Relation.Binary.Core using (Rel) |
| 18 |
open import Relation.Binary.Definitions |
| 19 |
using (Reflexive; Symmetric; Transitive) |
| 20 |
open import Relation.Binary.Core using (Rel) |
| 21 |
open import Relation.Binary.PropositionalEquality.Core as ≡ |
| 22 |
using (_≡_; subst; cong) |
| 23 |
|
| 24 |
module _ {s p x r} {X : Set x} (C : Container s p) (R : Rel X r) where |
| 25 |
|
| 26 |
refl : Reflexive R → Reflexive (Pointwise C R) |
| 27 |
refl R-refl = ≡.refl , λ p → R-refl |
| 28 |
|
| 29 |
sym : Symmetric R → Symmetric (Pointwise C R) |
| 30 |
sym R-sym (≡.refl , f) = ≡.refl , λ p → R-sym (f p) |
| 31 |
|
| 32 |
trans : Transitive R → Transitive (Pointwise C R) |
| 33 |
trans R-trans (≡.refl , f) (≡.refl , g) = ≡.refl , λ p → R-trans (f p) (g p) |
| 34 |
|
| 35 |
private |
| 36 |
|
| 37 |
-- Note that, if propositional equality were extensional, then |
| 38 |
-- Eq _≡_ and _≡_ would coincide. |
| 39 |
|
| 40 |
Eq⇒≡ : ∀ {s p x} {C : Container s p} {X : Set x} {xs ys : ⟦ C ⟧ X} → |
| 41 |
Extensionality p x → Pointwise C _≡_ xs ys → xs ≡ ys |
| 42 |
Eq⇒≡ ext (≡.refl , f≈f′) = cong -,_ (ext f≈f′) |