forked from agda/agda-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProperties.agda
More file actions
45 lines (38 loc) · 1.63 KB
/
Copy pathProperties.agda
File metadata and controls
45 lines (38 loc) · 1.63 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
36
37
38
39
40
41
42
43
44
45
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of the homogeneous prefix relation
------------------------------------------------------------------------
{-# OPTIONS --cubical-compatible --safe #-}
module Data.List.Relation.Binary.Prefix.Homogeneous.Properties where
open import Level
open import Function.Base using (_∘′_)
open import Relation.Binary
open import Data.List.Relation.Binary.Pointwise.Base as Pointwise using (Pointwise)
open import Data.List.Relation.Binary.Pointwise as Pointwise using (isEquivalence)
open import Data.List.Relation.Binary.Prefix.Heterogeneous
open import Data.List.Relation.Binary.Prefix.Heterogeneous.Properties
private
variable
a b r s : Level
A : Set a
B : Set b
R : REL A B r
S : REL A B s
isPreorder : IsPreorder R S → IsPreorder (Pointwise R) (Prefix S)
isPreorder po = record
{ isEquivalence = Pointwise.isEquivalence PO.isEquivalence
; reflexive = fromPointwise ∘′ Pointwise.map PO.reflexive
; trans = trans PO.trans
} where module PO = IsPreorder po
isPartialOrder : IsPartialOrder R S → IsPartialOrder (Pointwise R) (Prefix S)
isPartialOrder po = record
{ isPreorder = isPreorder PO.isPreorder
; antisym = antisym PO.antisym
} where module PO = IsPartialOrder po
isDecPartialOrder : IsDecPartialOrder R S → IsDecPartialOrder (Pointwise R) (Prefix S)
isDecPartialOrder dpo = record
{ isPartialOrder = isPartialOrder DPO.isPartialOrder
; _≟_ = Pointwise.decidable DPO._≟_
; _≤?_ = prefix? DPO._≤?_
} where module DPO = IsDecPartialOrder dpo