Debian Codegraph @

src/Data/List/Relation/Binary/Prefix/Homogeneous/Properties.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties of the homogeneous prefix relation
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Data.List.Relation.Binary.Prefix.Homogeneous.Properties where
10
11 open import Level
12 open import Function.Base using (_∘′_)
13 open import Relation.Binary.Core using (Rel; REL; _⇒_)
14 open import Relation.Binary.Structures
15 using (IsPreorder; IsPartialOrder; IsDecPartialOrder)
16
17 open import Data.List.Relation.Binary.Pointwise as Pointwise using (Pointwise)
18 open import Data.List.Relation.Binary.Prefix.Heterogeneous
19 open import Data.List.Relation.Binary.Prefix.Heterogeneous.Properties
20
21
22 private
23 variable
24 a b r s : Level
25 A : Set a
26 B : Set b
27 R : REL A B r
28 S : REL A B s
29
30 isPreorder : IsPreorder R S → IsPreorder (Pointwise R) (Prefix S)
31 isPreorder po = record
32 { isEquivalence = Pointwise.isEquivalence PO.isEquivalence
33 ; reflexive = fromPointwise ∘′ Pointwise.map PO.reflexive
34 ; trans = trans PO.trans
35 } where module PO = IsPreorder po
36
37 isPartialOrder : IsPartialOrder R S → IsPartialOrder (Pointwise R) (Prefix S)
38 isPartialOrder po = record
39 { isPreorder = isPreorder PO.isPreorder
40 ; antisym = antisym PO.antisym
41 } where module PO = IsPartialOrder po
42
43 isDecPartialOrder : IsDecPartialOrder R S → IsDecPartialOrder (Pointwise R) (Prefix S)
44 isDecPartialOrder dpo = record
45 { isPartialOrder = isPartialOrder DPO.isPartialOrder
46 ; _≟_ = Pointwise.decidable DPO._≟_
47 ; _≤?_ = prefix? DPO._≤?_
48 } where module DPO = IsDecPartialOrder dpo