Skip to content

Commit cc59d90

Browse files
authored
Define the category of posets (#1232)
1 parent cd0a375 commit cc59d90

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{-# OPTIONS --safe #-}
2+
module Cubical.Categories.Instances.Posets where
3+
4+
open import Cubical.Foundations.Prelude
5+
open import Cubical.Foundations.Function as Function
6+
open import Cubical.Foundations.HLevels
7+
open import Cubical.Foundations.Structure
8+
9+
open import Cubical.Relation.Binary.Order.Poset
10+
open import Cubical.Relation.Binary.Order.Poset.Mappings
11+
12+
open import Cubical.Categories.Category
13+
14+
open Category hiding (_∘_)
15+
16+
PosetsCategory : ℓ ℓ' Category (ℓ-max (ℓ-suc ℓ) (ℓ-suc ℓ')) (ℓ-max ℓ ℓ')
17+
PosetsCategory ℓ ℓ' .ob = Poset ℓ ℓ'
18+
PosetsCategory ℓ ℓ' .Hom[_,_] P Q = Σ[ f ∈ (⟨ P ⟩ ⟨ Q ⟩) ] IsIsotone (str P) f (str Q)
19+
PosetsCategory ℓ ℓ' .id = idfun _ , isisotone λ _ _ idfun _
20+
PosetsCategory ℓ ℓ' ._⋆_ (f , fMon) (g , gMon) = g ∘ f , IsIsotone-∘ _ _ _ _ _ fMon gMon
21+
PosetsCategory ℓ ℓ' .⋆IdL _ = refl
22+
PosetsCategory ℓ ℓ' .⋆IdR _ = refl
23+
PosetsCategory ℓ ℓ' .⋆Assoc _ _ _ = refl
24+
PosetsCategory ℓ ℓ' .isSetHom {x = P} {y = Q} = isSetΣSndProp (isSet→ Q.is-set) λ _ isPropIsIsotone _ _ _
25+
where module Q = PosetStr (str Q)

Cubical/Relation/Binary/Order/Poset/Mappings.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ record IsIsotone {A : Type ℓ₀} {B : Type ℓ₁}
3838
(M : PosetStr ℓ₀' A) (f : A B) (N : PosetStr ℓ₁' B)
3939
: Type (ℓ-max (ℓ-max ℓ₀ ℓ₀') ℓ₁')
4040
where
41+
constructor isisotone
4142
-- Shorter qualified names
4243
private
4344
module M = PosetStr M
@@ -67,8 +68,7 @@ record IsAntitone {A : Type ℓ₀} {B : Type ℓ₁}
6768
(M : PosetStr ℓ₀' A) (f : A B) (N : PosetStr ℓ₁' B)
6869
: Type (ℓ-max (ℓ-max ℓ₀ ℓ₀') ℓ₁')
6970
where
70-
constructor
71-
isantitone
71+
constructor isantitone
7272
-- Shorter qualified names
7373
private
7474
module M = PosetStr M

0 commit comments

Comments
 (0)