Library structures.Posets
Partially ordered sets
Unbundled definitions
Class PartialOrder {P} (R : relation P) :=
{
po_preorder :> PreOrder R;
po_antisym :> Antisymmetric P eq R;
}.
Class IsSup `{PartialOrder} {I} (x : I → P) (u : P) :=
{
sup_ub i : R (x i) u;
sup_lub y : (∀ i, R (x i) y) → R u y;
}.
Section SUP_PROPERTIES.
Context `{Ppo : PartialOrder}.
Lemma sup_unique {I} {x : I → P} (u v : P) `{!IsSup x u} `{!IsSup x v} :
u = v.
Lemma sup_at {I y u} `{Hu : !IsSup y u} (i : I) (x : P) :
R x (y i) → R x u.
Lemma sup_iff {I} (x : I → P) {u : P} `{Hz : !IsSup x u} (y : P) :
R u y ↔ ∀ i, R (x i) y.
End SUP_PROPERTIES.
Class IsInf `{PartialOrder} {I} (y : I → P) (u : P) :=
{
inf_lb i : R u (y i);
inf_glb x : (∀ i, R x (y i)) → R x u;
}.
Section INF_PROPERTIES.
Context `{Rpo : PartialOrder}.
Lemma inf_unique {I} (x : I → P) (u v : P) :
IsInf x u →
IsInf x v →
u = v.
Lemma inf_at {I x u} `{Hu : !IsInf x u} (i : I) (y : P) :
R (x i) y → R u y.
Lemma inf_iff {I} (y : I → P) {u : P} `{Hu : !IsInf y u} (x : P) :
R x u ↔ ∀ i, R x (y i).
End INF_PROPERTIES.
As extra structure for sets
Class Poset (P : Type) :=
{
ref : relation P;
ref_po :> PartialOrder ref;
}.
Module Poset <: ConcreteCategory.
Class Structure (P : Type) : Type :=
structure_poset : Poset P.
Global Hint Immediate structure_poset : typeclass_instances.
Global Hint Extern 1 (Structure _) ⇒ red : typeclass_instances.
Class Morphism {A B} `{Apos: Poset A} `{Bpos: Poset B} (f : A → B) :=
morphism_monotonic :> Monotonic f (ref ++> ref).
Global Instance id_mor `{Poset} :
Morphism (fun x ⇒ x).
Global Instance compose_mor :
∀ {A B C} `{Poset A} `{Poset B} `{Poset C} (g: B → C) (f: A → B),
Morphism g →
Morphism f →
Morphism (fun x ⇒ g (f x)).
Include ConcreteCategoryTheory.
End Poset.
Notation poset := Poset.structured_set.
Declare Scope poset_scope.
Delimit Scope poset_scope with poset.
Bind Scope poset_scope with poset.
Declare Scope poselt_scope.
Delimit Scope poselt_scope with poselt.
Bind Scope poselt_scope with Poset.carrier.
Infix "≤" := ref.