module Order.Diagram.Lub.Reasoning {o β} (P : Poset o β) where
Reasoning about least upper boundsπ
This module provides syntax and reasoning combinators for working with partial orders that have all least upper bounds.
module Lubs {β : β {I : Type o} (f : I β Ob) β Ob} (β-lubs : β {I : Type o} (f : I β Ob) β is-lub P f (β f)) where lubs : β {I : Type o} (f : I β Ob) β Lub P f lubs f = record { lub = β f ; has-lub = β-lubs f } module β-lubs {I} {f : I β Ob} = is-lub (β-lubs f) open β-lubs using () renaming (famβ€lub to β-inj; least to β-universal) public
Performing two nested joins over and is the same as taking a single join over
β-twice : β {I : Type o} {J : I β Type o} (F : (i : I) β J i β Ob) β β (Ξ» i β β Ξ» j β F i j) β‘ β {I = Ξ£ I J} (Ξ» p β F (p .fst) (p .snd)) β-twice F = β€-antisym (β-universal _ (Ξ» i β β-universal _ (Ξ» j β β-inj _))) (β-universal _ Ξ» (i , j) β β€-trans (β-inj j) (β-inj i))
Let and be a pair of families. If there is a map such that then the meet of is smaller than the meet of
ββ€β-over : β {I J : Type o} {f : I β Ob} {g : J β Ob} β (to : I β J) β (β i β f i β€ g (to i)) β β f β€ β g ββ€β-over to p = β-universal _ Ξ» i β β€-trans (p i) (β-inj (to i))
As a corollary, if is smaller than for each then the join of is smaller than the join of
ββ€β : β {I : Type o} {f g : I β Ob} β (β i β f i β€ g i) β β f β€ β g ββ€β = ββ€β-over (Ξ» i β i)
Taking the join over a contractible family is equal the unique value of the family.
β-singleton : β {I : Type o} {f : I β Ob} β (p : is-contr I) β β f β‘ f (p .centre) β-singleton {f = f} p = β€-antisym (β-universal _ Ξ» i β β€-refl' $ sym $ ap f (p .paths i)) (β-inj _)
We also provide syntax for binary joins and bottom elements.
module _ (x y : Ob) where opaque private it : Join P x y it = LubβJoin (lower-lub (lubs _)) infixr 24 _βͺ_ _βͺ_ : Ob _βͺ_ = it .Join.lub βͺ-joins : is-join P x y _βͺ_ βͺ-joins = it .Join.has-join opaque has-bottom : Bottom has-bottom = LubβBottom (lower-lub (lubs (Ξ» ()))) open Joins βͺ-joins public open Bottom has-bottom using (bot; Β‘) public
There is a distributive law relating binary and infinitary joins.
βͺ-distrib-β-β€l : β {I : Type o} {x : Ob} {f : I β Ob} β β (Ξ» i β x βͺ f i) β€ x βͺ β f βͺ-distrib-β-β€l = β-universal _ Ξ» i β βͺ-universal _ lβ€βͺ (β€-trans (β-inj i) rβ€βͺ)
If the infinitary join is taken over a non-empty family, then the previous distributive law can be extended to an equality.
βͺ-distrib-nonempty-β-l : β {I : Type o} {x : Ob} {f : I β Ob} β β₯ I β₯ β β (Ξ» i β x βͺ f i) β‘ x βͺ β f βͺ-distrib-nonempty-β-l i = β€-antisym βͺ-distrib-β-β€l (rec! (Ξ» i β βͺ-universal _ (β€-trans lβ€βͺ (β-inj i)) (ββ€β Ξ» _ β rβ€βͺ)) i)
β-ap : β {I I' : Type o} {f : I β Ob} {g : I' β Ob} β (e : I β I') β (β i β f i β‘ g (e .fst i)) β β f β‘ β g β-ap e p = apβ (Ξ» I f β β {I = I} f) (ua e) (uaβ p) -- raised i for "index", raised f for "family" β-apβ± : β {I I' : Type o} {f : I' β Ob} (e : I β I') β β (Ξ» i β f (e .fst i)) β‘ β f β-apαΆ : β {I : Type o} {f g : I β Ob} β (β i β f i β‘ g i) β β f β‘ β g β-apβ± e = β-ap e (Ξ» i β refl) β-apαΆ p = β-ap (_ , id-equiv) p
Large joinsπ
Let be a poset. If has all joins of size then it has all joins, regardless of size.
is-cocompleteβis-large-cocomplete : (lubs : β {I : Type o} (f : I β Ob) β Lub P f) β β {β} {I : Type β} (F : I β Ob) β Lub P F is-cocompleteβis-large-cocomplete lubs {I = I} F = cover-preserves-lub (Ξ©-corestriction-is-surjective F) (lubs fst)
We also provide some notation for large joins.
module Large {β : {I : Type o} (F : I β Ob) β Ob} (β-lubs : β {I} f β is-lub P f (β {I} f)) where open Lubs β-lubs using (lubs) opaque βα΄Έ : β {β} {I : Type β} (F : I β Ob) β Ob βα΄Έ F = is-cocompleteβis-large-cocomplete lubs F .Lub.lub βα΄Έ-inj : β {β} {I : Type β} {F : I β Ob} (i : I) β F i β€ βα΄Έ F βα΄Έ-inj = Lub.famβ€lub (is-cocompleteβis-large-cocomplete lubs _) βα΄Έ-universal : β {β} {I : Type β} {F : I β Ob} (x : Ob) β (β i β F i β€ x) β βα΄Έ F β€ x βα΄Έ-universal = Lub.least (is-cocompleteβis-large-cocomplete lubs _)
βα΄Έ-ap : β {β β'} {I : Type β} {I' : Type β'} {f : I β Ob} {g : I' β Ob} β (e : I β I') β (β i β f i β‘ g (e .fst i)) β βα΄Έ f β‘ βα΄Έ g βα΄Έ-ap {g = g} e p = β€-antisym (βα΄Έ-universal _ Ξ» i β β€-trans (β€-refl' (p i)) (βα΄Έ-inj _)) (βα΄Έ-universal _ Ξ» i β β€-trans (β€-refl' (ap g (sym (Equiv.Ξ΅ e i)) β sym (p (Equiv.from e _)))) (βα΄Έ-inj _)) -- raised i for "index", raised f for "family" βα΄Έ-apβ± : β {β β'} {I : Type β} {I' : Type β'} {f : I' β Ob} (e : I β I') β βα΄Έ (Ξ» i β f (e .fst i)) β‘ βα΄Έ f βα΄Έ-apαΆ : β {β} {I : Type β} {f g : I β Ob} β (β i β f i β‘ g i) β βα΄Έ f β‘ βα΄Έ g βα΄Έ-apβ± e = βα΄Έ-ap e (Ξ» i β refl) βα΄Έ-apαΆ p = βα΄Έ-ap (_ , id-equiv) p