Debian Codegraph @

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

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