| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Properties of the homogeneous suffix relation |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.List.Relation.Binary.Suffix.Homogeneous.Properties where |
| 10 |
|
| 11 |
open import Level |
| 12 |
open import Function.Base using (_∘′_) |
| 13 |
open import Relation.Binary.Core using (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.Suffix.Heterogeneous |
| 19 |
open import Data.List.Relation.Binary.Suffix.Heterogeneous.Properties |
| 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) (Suffix 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) (Suffix 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) (Suffix S) |
| 43 |
isDecPartialOrder dpo = record |
| 44 |
{ isPartialOrder = isPartialOrder DPO.isPartialOrder |
| 45 |
; _≟_ = Pointwise.decidable DPO._≟_ |
| 46 |
; _≤?_ = suffix? DPO._≤?_ |
| 47 |
} where module DPO = IsDecPartialOrder dpo |