module Order.Instances.Pointwise where
The pointwise orderingπ
The product of a family of partially ordered sets is a poset, for any index type which we might choose! There might be other ways of making into a poset, of course, but the canonical way weβre talking about here is the pointwise ordering on where iff for all
Pointwise : β {β ββ βα΅£} (I : Type β) (P : I β Poset ββ βα΅£) β Poset (β β ββ) (β β βα΅£) Pointwise I P = po where open module PrP {i : I} = Pr (P i) po : Poset _ _ po .Poset.Ob = (i : I) β β P i β po .Poset._β€_ f g = β x β f x β€ g x po .Poset.β€-thin = hlevel 1 po .Poset.β€-refl x = β€-refl po .Poset.β€-trans fβ€g gβ€h x = β€-trans (fβ€g x) (gβ€h x) po .Poset.β€-antisym fβ€g gβ€f = funext Ξ» x β β€-antisym (fβ€g x) (gβ€f x) tupleα΅ : β {β ββ ββ' βα΅£ βα΅£'} {I : Type β} {P : I β Poset ββ βα΅£} {R : Poset ββ' βα΅£'} β (β i β Monotone R (P i)) β Monotone R (Pointwise I P) tupleα΅ f .hom x i = f i # x tupleα΅ f .pres-β€ xβ€y i = f i .pres-β€ xβ€y prjα΅ : β {β ββ βα΅£} {I : Type β} {P : I β Poset ββ βα΅£} (i : I) β Monotone (Pointwise I P) (P i) prjα΅ i .hom f = f i prjα΅ i .pres-β€ fβ€g = fβ€g i
A very important particular case of the pointwise ordering is the poset of subsets of a fixed type, which has underlying set
Subsets : β {β} β Type β β Poset β β Subsets A = Pointwise A (Ξ» _ β Props)
Another important case: when your domain is not an arbitrary type but another poset, you might want to consider the full subposet of consisting of the monotone maps:
Poset[_,_] : β {ββ βα΅£ ββ' βα΅£'} β (P : Poset ββ βα΅£) (Q : Poset ββ' βα΅£') β Poset (ββ β βα΅£ β ββ' β βα΅£') (ββ β βα΅£') Poset[_,_] P Q = po module Poset[_,_] where open Pr Q po : Poset _ _ po .Poset.Ob = Monotone P Q po .Poset._β€_ f g = β (x : β P β) β f # x β€ g # x po .Poset.β€-thin = hlevel 1 po .Poset.β€-refl _ = β€-refl po .Poset.β€-trans fβ€g gβ€h x = β€-trans (fβ€g x) (gβ€h x) po .Poset.β€-antisym fβ€g gβ€f = ext Ξ» x β β€-antisym (fβ€g x) (gβ€f x)
Using Pointwise
we can show that
has all indexed products:
Posets-has-indexed-products : β {o β β'} β has-indexed-products (Posets (o β β') (β β β')) β' Posets-has-indexed-products F = mk where mk : Indexed-product (Posets _ _) _ mk .Ξ F = Pointwise _ F mk .Ο = prjα΅ mk .has-is-ip .tuple = tupleα΅ mk .has-is-ip .commute = trivial! mk .has-is-ip .unique f g = ext Ξ» y i β g i #β y
Binary products are a special case of indexed productsπ
Γβ‘Pointwise-bool : β {o β} (P Q : Poset o β) β P Γα΅ Q β‘ Pointwise Bool (if_then P else Q) Γβ‘Pointwise-bool P Q = Poset-path Ξ» where .to β tupleα΅ (Bool-elim _ fstα΅ sndα΅) .from β pairα΅ (prjα΅ true) (prjα΅ false) .inverses .invl β ext Ξ» where x true β refl x false β refl .inverses .invr β ext Ξ» x y β refl , refl