module Order.Diagram.Glb.Reasoning {o â} (P : Poset o â) where
Reasoning about greatest lower boundsð
This module provides syntax and reasoning combinators for working with partial orders that have all greatest lower bounds.
module Glbs {â : â {I : Type o} (f : I â Ob) â Ob} (â-glbs : â {I : Type o} (f : I â Ob) â is-glb P f (â f)) where glbs : â {I : Type o} (f : I â Ob) â Glb P f glbs f = record { glb = â f ; has-glb = â-glbs f } module glbs {I} {f : I â Ob} = Glb (glbs f) open glbs using () renaming (glbâ€fam to â-proj; greatest to â-universal) public
Performing two nested meets over and is the same as taking a single meet 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 , j) â â€-trans (â-proj i) (â-proj {f = f i} j))) (â-universal _ λ i â â-universal _ λ j â â-proj (i , j))
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 : J â Ob} {g : I â Ob} â (to : I â J) â (â i â f (to i) †g i) â â f †â g ââ€â-over to p = â-universal _ λ i â â€-trans (â-proj (to i)) (p i)
As a corollary, if is smaller than for each then the meet of is smaller than the meet of
ââ€â : {I : Type o} {f g : I â Ob} â (â i â f i †g i) â â f †â g ââ€â p = ââ€â-over (λ i â i) p
Taking the meet 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 (â-proj (p .centre)) (â-universal _ λ i â â€-refl' (ap f (p .paths i)))
We also provide syntax for binary meets and top elements.
module _ (x y : Ob) where opaque private it : Meet P x y it = GlbâMeet (lower-glb (glbs _)) infixr 25 _â©_ _â©_ : Ob _â©_ = it .Meet.glb â©-meets : is-meet P x y _â©_ â©-meets = it .Meet.has-meet opaque has-top : Top has-top = GlbâTop (lower-glb (glbs (λ ()))) open Meets â©-meets public open Top has-top using (top; !) public
There is a distributive law relating binary and infinitary meets.
â©-distrib-â-â€l : â {I : Type o} {x : Ob} {f : I â Ob} â x â© â f †â λ i â x â© f i â©-distrib-â-â€l = (â-universal _ λ i â â©-universal _ â©â€l (â€-trans â©â€r (â-proj i)))
If the infinitary meet 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 ⥠â x â© â f â¡ â λ i â x â© f i â©-distrib-nonempty-â-l i = â€-antisym â©-distrib-â-â€l (rec! (λ i â â©-universal _ (â€-trans (â-proj i) â©â€l) (ââ€â λ _ â â©â€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 meetsð
Let be a poset. If has all meets of size then it has all meets, regardless of size.
is-completeâis-large-complete : (glbs : â {I : Type o} (f : I â Ob) â Glb P f) â â {â} {I : Type â} (F : I â Ob) â Glb P F is-completeâis-large-complete glbs {I = I} F = cover-preserves-glb (Ω-corestriction-is-surjective F) (glbs fst)
We also provide some notation for large meets.
module Large {â : â {I : Type o} (f : I â Ob) â Ob} (â-glbs : â {I : Type o} (f : I â Ob) â is-glb P f (â f)) where open Glbs â-glbs using (glbs) opaque â᎞ : â {â} {I : Type â} (F : I â Ob) â Ob â᎞ F = is-completeâis-large-complete glbs F .Glb.glb â᎞-proj : â {â} {I : Type â} {F : I â Ob} (i : I) â â᎞ F †F i â᎞-proj = Glb.glbâ€fam (is-completeâis-large-complete glbs _) â᎞-universal : â {â} {I : Type â} {F : I â Ob} (x : Ob) â (â i â x †F i) â x †â᎞ F â᎞-universal = Glb.greatest (is-completeâis-large-complete glbs _)
â᎞-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 (â᎞-proj (Equiv.from e i)) (â€-refl' (p _ â ap g (Equiv.ε e i)))) (â᎞-universal _ λ i â â€-trans (â᎞-proj (Equiv.to e i)) (â€-refl' (sym (p i)))) -- 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