{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core using (Category)
open import Categories.Category.Restriction using (Restriction)
open import Relation.Binary.Bundles using (Poset)
open import Relation.Binary.Structures using (IsPartialOrder)
import Categories.Morphism.Reasoning as MR
module Categories.Category.Restriction.Properties.Poset {o β e} {π : Category o β e} (R : Restriction π) where
open Category π
open Restriction R
open Equiv
open HomReasoning
open MR π using (pullΚ³; pullΛ‘)
poset : (A B : Obj) β Poset β e e
poset A B = record
{ Carrier = A β B
; _β_ = _β_
; _β€_ = Ξ» f g β f β g β f β
; isPartialOrder = record
{ isPreorder = record
{ isEquivalence = equiv
; reflexive = Ξ» {x} {y} xβy β begin
x βΛβ¨ pidΚ³ β©
x β x β ββ¨ xβy β©ββ¨refl β©
y β x β β
; trans = Ξ» {i} {j} {k} iβjβiβ jβkβjβ β begin
i ββ¨ iβjβiβ β©
j β i β ββ¨ jβkβjβ β©ββ¨refl β©
(k β j β) β i β ββ¨ pullΚ³ (sym β-denestΚ³) β©
k β (j β i β) β ββ¨ reflβ©ββ¨ β-cong (sym iβjβiβ) β©
k β i β β
}
; antisym = Ξ» {i} {j} iβjβiβ jβiβjβ β begin
i ββ¨ iβjβiβ β©
j β i β ββ¨ jβiβjβ β©ββ¨refl β©
(i β j β) β i β ββ¨ pullΚ³ β-comm β©
i β i β β j β ββ¨ pullΛ‘ pidΚ³ β©
i β j β βΛβ¨ jβiβjβ β©
j β
}
}