Tom de Jong, May 2019. Refactored January 2020, December 2021. February 2022: Show that pointed dcpos have semidirected and subsingleton suprema. We define dcpos with a least element, typically denoted by β₯, which are called pointed dcpos. A map between pointed dcpos is called strict if it preserves least elements. We show that every isomorphism of dcpos is strict. Finally, we show that pointed dcpos have semidirected and subsingleton suprema and that these are preserved by maps that are both strict and Scott continuous. \begin{code} {-# OPTIONS --safe --without-K #-} open import MLTT.Spartan open import UF.FunExt open import UF.PropTrunc module DomainTheory.Basics.Pointed (pt : propositional-truncations-exist) (fe : Fun-Ext) (π₯ : Universe) where open PropositionalTruncation pt hiding (_β¨_) open import UF.Subsingletons open import DomainTheory.Basics.Dcpo pt fe π₯ open import DomainTheory.Basics.Miscelanea pt fe π₯ module _ {π€ π£ : Universe} where DCPOβ₯ : (π₯ βΊ) β (π€ βΊ) β (π£ βΊ) Μ DCPOβ₯ = Ξ£ π κ DCPO {π€} {π£} , has-least (underlying-order π) _β» : DCPOβ₯ β DCPO _β» = prβ βͺ_β« : DCPOβ₯ β π€ Μ βͺ π β« = β¨ π β» β© underlying-orderβ₯ : (π : DCPOβ₯) β βͺ π β« β βͺ π β« β π£ Μ underlying-orderβ₯ π = underlying-order (π β») syntax underlying-orderβ₯ π x y = x ββͺ π β« y β₯ : (π : DCPOβ₯) β β¨ π β» β© β₯ (π , x , p) = x β₯-is-least : (π : DCPOβ₯) β is-least (underlying-order (π β»)) (β₯ π) β₯-is-least (π , x , p) = p transitivity'' : (π : DCPOβ₯) (x : βͺ π β«) {y z : βͺ π β«} β x ββͺ π β« y β y ββͺ π β« z β x ββͺ π β« z transitivity'' π = transitivity' (π β») reflexivity' : (π : DCPOβ₯) β reflexive (underlying-order (π β»)) reflexivity' (D , _) = reflexivity D syntax transitivity'' π x u v = x ββͺ π β«[ u ] v infixr 0 transitivity'' syntax reflexivity' π x = x ββͺ π β« infix 1 reflexivity' is-a-non-trivial-pointed-dcpo : (π : DCPOβ₯ {π€} {π£}) β π€ Μ is-a-non-trivial-pointed-dcpo π = β x κ βͺ π β« , x β β₯ π οΌ-to-β₯-criterion : (π : DCPOβ₯ {π€} {π£}) {x : βͺ π β«} β x ββͺ π β« β₯ π β x οΌ β₯ π οΌ-to-β₯-criterion π {x} x-below-β₯ = antisymmetry (π β») x (β₯ π) x-below-β₯ (β₯-is-least π x) DCPOβ₯[_,_] : DCPOβ₯ {π€} {π£} β DCPOβ₯ {π€'} {π£'} β (π₯ βΊ) β π€ β π£ β π€' β π£' Μ DCPOβ₯[ π , π ] = DCPO[ π β» , π β» ] is-strict : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) β (βͺ π β« β βͺ π β«) β π€' Μ is-strict π π f = f (β₯ π) οΌ β₯ π β-is-strict : {π€'' π£'' : Universe} (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (π' : DCPOβ₯ {π€''} {π£''}) (f : βͺ π β« β βͺ π β«) (g : βͺ π β« β βͺ π' β«) β is-strict π π f β is-strict π π' g β is-strict π π' (g β f) β-is-strict π π π' f g sf sg = ap g sf β sg being-strict-is-prop : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (f : βͺ π β« β βͺ π β«) β is-prop (is-strict π π f) being-strict-is-prop π π f = sethood (π β») strictness-criterion : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (f : βͺ π β« β βͺ π β«) β f (β₯ π) ββͺ π β« β₯ π β is-strict π π f strictness-criterion π π f crit = antisymmetry (π β») (f (β₯ π)) (β₯ π) crit (β₯-is-least π (f (β₯ π))) \end{code} Defining isomorphisms of pointed dcpos and showing that every isomorphism of dcpos is automatically strict. \begin{code} _βα΅αΆα΅α΅β₯_ : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) β π₯ βΊ β π€ β π£ β π€' β π£' Μ π βα΅αΆα΅α΅β₯ π = Ξ£ f κ (β¨ π β» β© β β¨ π β» β©) , Ξ£ g κ (β¨ π β» β© β β¨ π β» β©) , ((d : β¨ π β» β©) β g (f d) οΌ d) Γ ((e : β¨ π β» β©) β f (g e) οΌ e) Γ is-continuous (π β») (π β») f Γ is-continuous (π β») (π β») g Γ is-strict π π f Γ is-strict π π g βα΅αΆα΅α΅β₯-to-βα΅αΆα΅α΅ : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) β π βα΅αΆα΅α΅β₯ π β (π β») βα΅αΆα΅α΅ (π β») βα΅αΆα΅α΅β₯-to-βα΅αΆα΅α΅ π π (f , g , s , r , cf , cg , sf , sg) = f , g , s , r , cf , cg βα΅αΆα΅α΅-to-βα΅αΆα΅α΅β₯ : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) β (π β») βα΅αΆα΅α΅ (π β») β π βα΅αΆα΅α΅β₯ π βα΅αΆα΅α΅-to-βα΅αΆα΅α΅β₯ π π (f , g , gf , fg , cf , cg) = f , g , gf , fg , cf , cg , sf , sg where sf : is-strict π π f sf = antisymmetry (π β») (f (β₯ π)) (β₯ π) Ξ³ (β₯-is-least π (f (β₯ π))) where Ξ³ = f (β₯ π) ββ¨ π β» β©[ lβ ] f (g (β₯ π)) ββ¨ π β» β©[ lβ ] β₯ π ββ¨ π β» β© where lβ = monotone-if-continuous (π β») (π β») (f , cf) (β₯ π) (g (β₯ π)) (β₯-is-least π (g (β₯ π))) lβ = οΌ-to-β (π β») (fg (β₯ π)) sg : is-strict π π g sg = antisymmetry (π β») (g (β₯ π)) (β₯ π) Ξ³ (β₯-is-least π (g (β₯ π))) where Ξ³ = g (β₯ π) ββ¨ π β» β©[ lβ ] g (f (β₯ π)) ββ¨ π β» β©[ lβ ] β₯ π ββ¨ π β» β© where lβ = monotone-if-continuous (π β») (π β») (g , cg) (β₯ π) (f (β₯ π)) (β₯-is-least π (f (β₯ π))) lβ = οΌ-to-β (π β») (gf (β₯ π)) \end{code} Pointed dcpos have semidirected & subsingleton suprema and these are preserved by maps that are both strict and continuous. This is used to prove (in DomainTheroy.Lifting.LiftingSet.lagda) that the lifting yields the free pointed dcpo on a set. \begin{code} add-β₯ : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) β (π{π₯} + I) β βͺ π β« add-β₯ π Ξ± (inl β) = β₯ π add-β₯ π Ξ± (inr i) = Ξ± i add-β₯-is-directed : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} β is-semidirected (underlying-order (π β»)) Ξ± β is-Directed (π β») (add-β₯ π Ξ±) add-β₯-is-directed π {I} {Ξ±} Ο = β£ inl β β£ , Ξ΄ where Ξ΄ : is-semidirected (underlying-order (π β»)) (add-β₯ π Ξ±) Ξ΄ (inl β) a = β£ a , β₯-is-least π (add-β₯ π Ξ± a) , reflexivity (π β») (add-β₯ π Ξ± a) β£ Ξ΄ (inr i) (inl β) = β£ (inr i) , reflexivity (π β») (Ξ± i) , β₯-is-least π (Ξ± i) β£ Ξ΄ (inr i) (inr j) = β₯β₯-functor (Ξ» (k , u , v) β (inr k , u , v)) (Ο i j) adding-β₯-preserves-sup : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) (x : βͺ π β«) β is-sup (underlying-order (π β»)) x Ξ± β is-sup (underlying-order (π β»)) x (add-β₯ π Ξ±) adding-β₯-preserves-sup π {I} Ξ± x x-is-sup = x-is-ub , x-is-lb-of-ubs where x-is-ub : (i : π + I) β add-β₯ π Ξ± i ββͺ π β« x x-is-ub (inl β) = β₯-is-least π x x-is-ub (inr i) = sup-is-upperbound (underlying-order (π β»)) x-is-sup i x-is-lb-of-ubs : is-lowerbound-of-upperbounds (underlying-order (π β»)) x (add-β₯ π Ξ±) x-is-lb-of-ubs y y-is-ub = sup-is-lowerbound-of-upperbounds (underlying-order (π β»)) x-is-sup y (Ξ» i β y-is-ub (inr i)) adding-β₯-reflects-sup : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) (x : βͺ π β«) β is-sup (underlying-order (π β»)) x (add-β₯ π Ξ±) β is-sup (underlying-order (π β»)) x Ξ± adding-β₯-reflects-sup π {I} Ξ± x x-is-sup = x-is-ub , x-is-lb-of-ubs where x-is-ub : (i : I) β Ξ± i ββͺ π β« x x-is-ub i = sup-is-upperbound (underlying-order (π β»)) x-is-sup (inr i) x-is-lb-of-ubs : is-lowerbound-of-upperbounds (underlying-order (π β»)) x Ξ± x-is-lb-of-ubs y y-is-ub = sup-is-lowerbound-of-upperbounds (underlying-order (π β»)) x-is-sup y h where h : is-upperbound (underlying-order (π β»)) y (add-β₯ π Ξ±) h (inl β) = β₯-is-least π y h (inr i) = y-is-ub i semidirected-complete-if-pointed : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} β is-semidirected (underlying-order (π β»)) Ξ± β has-sup (underlying-order (π β»)) Ξ± semidirected-complete-if-pointed π {I} {Ξ±} Ο = x , x-is-sup where Ξ΄ : is-Directed (π β») (add-β₯ π Ξ±) Ξ΄ = add-β₯-is-directed π Ο x : βͺ π β« x = β (π β») Ξ΄ x-is-sup : is-sup (underlying-order (π β»)) x Ξ± x-is-sup = adding-β₯-reflects-sup π Ξ± x (β-is-sup (π β») Ξ΄) pointed-if-semidirected-complete : (π : DCPO {π€} {π£}) β ({I : π₯ Μ } {Ξ± : I β β¨ π β©} β is-semidirected (underlying-order π) Ξ± β has-sup (underlying-order π) Ξ±) β has-least (underlying-order π) pointed-if-semidirected-complete π c = x , x-is-least where Ξ± : π β β¨ π β© Ξ± = π-elim Ο : is-semidirected (underlying-order π) Ξ± Ο = π-induction x : β¨ π β© x = the-sup (underlying-order π) (c Ο) x-is-least : is-least (underlying-order π) x x-is-least y = sup-is-lowerbound-of-upperbounds (underlying-order π) (sup-property (underlying-order π) (c Ο)) y π-induction βΛ’α΅ : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} β is-semidirected (underlying-order (π β»)) Ξ± β βͺ π β« βΛ’α΅ π {I} {Ξ±} Ο = prβ (semidirected-complete-if-pointed π Ο) βΛ’α΅-in-terms-of-β : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} (Ο : is-semidirected (underlying-order (π β»)) Ξ±) β βΛ’α΅ π Ο οΌ β (π β») (add-β₯-is-directed π Ο) βΛ’α΅-in-terms-of-β π {I} {Ξ±} Ο = refl preserves-semidirected-sups-if-continuous-and-strict : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (f : βͺ π β« β βͺ π β«) β is-continuous (π β») (π β») f β is-strict π π f β {I : π₯ Μ } {Ξ± : I β βͺ π β«} β (Ο : is-semidirected (underlying-order (π β»)) Ξ±) β is-sup (underlying-order (π β»)) (f (βΛ’α΅ π Ο)) (f β Ξ±) preserves-semidirected-sups-if-continuous-and-strict π π f con str {I} {Ξ±} Ο = ub , lb-of-ubs where Ξ΄ : is-Directed (π β») (add-β₯ π Ξ±) Ξ΄ = add-β₯-is-directed π Ο claimβ : is-sup (underlying-order (π β»)) (f (β (π β») Ξ΄)) (f β add-β₯ π Ξ±) claimβ = con (π + I) (add-β₯ π Ξ±) (add-β₯-is-directed π Ο) claimβ : is-sup (underlying-order (π β»)) (f (βΛ’α΅ π Ο)) (f β add-β₯ π Ξ±) claimβ = transportβ»ΒΉ (Ξ» - β is-sup (underlying-order (π β»)) (f -) (f β (add-β₯ π Ξ±))) (βΛ’α΅-in-terms-of-β π Ο) claimβ ub : (i : I) β f (Ξ± i) ββͺ π β« f (βΛ’α΅ π Ο) ub i = sup-is-upperbound (underlying-order (π β»)) claimβ (inr i) lb-of-ubs : is-lowerbound-of-upperbounds (underlying-order (π β»)) (f (βΛ’α΅ π Ο)) (f β Ξ±) lb-of-ubs y y-is-ub = sup-is-lowerbound-of-upperbounds (underlying-order (π β»)) claimβ y h where h : is-upperbound (underlying-order (π β»)) y (f β add-β₯ π Ξ±) h (inl β) = f (β₯ π) ββͺ π β«[ οΌ-to-β (π β») str ] β₯ π ββͺ π β«[ β₯-is-least π y ] y ββͺ π β« h (inr i) = y-is-ub i subsingleton-indexed-is-semidirected : (π : DCPO {π€} {π£}) {I : π₯ Μ } (Ξ± : I β β¨ π β©) β is-prop I β is-semidirected (underlying-order π) Ξ± subsingleton-indexed-is-semidirected π Ξ± Ο i j = β£ i , r , r' β£ where r : Ξ± i ββ¨ π β© Ξ± i r = reflexivity π (Ξ± i) r' : Ξ± j ββ¨ π β© Ξ± i r' = transport (Ξ» k β Ξ± k ββ¨ π β© Ξ± i) (Ο i j) r subsingleton-complete-if-pointed : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) β is-prop I β has-sup (underlying-order (π β»)) Ξ± subsingleton-complete-if-pointed π Ξ± Ο = semidirected-complete-if-pointed π Ο where Ο : is-semidirected (underlying-order (π β»)) Ξ± Ο = subsingleton-indexed-is-semidirected (π β») Ξ± Ο βΛ’Λ’ : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) β is-prop I β βͺ π β« βΛ’Λ’ π {I} Ξ± Ο = prβ (subsingleton-complete-if-pointed π Ξ± Ο) βΛ’Λ’-in-terms-of-βΛ’α΅ : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} (Ο : is-prop I) β βΛ’Λ’ π Ξ± Ο οΌ βΛ’α΅ π (subsingleton-indexed-is-semidirected (π β») Ξ± Ο) βΛ’Λ’-in-terms-of-βΛ’α΅ π {I} {Ξ±} Ο = refl preserves-subsingleton-sups-if-continuous-and-strict : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (f : βͺ π β« β βͺ π β«) β is-continuous (π β») (π β») f β is-strict π π f β {I : π₯ Μ } (Ξ± : I β βͺ π β«) β (Ο : is-prop I) β is-sup (underlying-order (π β»)) (f (βΛ’Λ’ π Ξ± Ο)) (f β Ξ±) preserves-subsingleton-sups-if-continuous-and-strict π π f con str Ξ± Ο = preserves-semidirected-sups-if-continuous-and-strict π π f con str (subsingleton-indexed-is-semidirected (π β») Ξ± Ο) βΛ’Λ’-is-upperbound : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) (Ο : is-prop I) β is-upperbound (underlying-order (π β»)) (βΛ’Λ’ π Ξ± Ο) Ξ± βΛ’Λ’-is-upperbound π {I} Ξ± Ο i = β-is-upperbound (π β») Ξ΄ (inr i) where Ξ΄ : is-Directed (π β») (add-β₯ π Ξ±) Ξ΄ = add-β₯-is-directed π (subsingleton-indexed-is-semidirected (π β») Ξ± Ο) βΛ’Λ’-is-lowerbound-of-upperbounds : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) (Ο : is-prop I) β is-lowerbound-of-upperbounds (underlying-order (π β»)) (βΛ’Λ’ π Ξ± Ο) Ξ± βΛ’Λ’-is-lowerbound-of-upperbounds π {I} Ξ± Ο y y-is-ub = β-is-lowerbound-of-upperbounds (π β») Ξ΄ y h where Ξ΄ : is-Directed (π β») (add-β₯ π Ξ±) Ξ΄ = add-β₯-is-directed π (subsingleton-indexed-is-semidirected (π β») Ξ± Ο) h : (i : π + I) β add-β₯ π Ξ± i ββͺ π β« y h (inl β) = β₯-is-least π y h (inr i) = y-is-ub i βΛ’Λ’-is-sup : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } (Ξ± : I β βͺ π β«) (Ο : is-prop I) β is-sup (underlying-order (π β»)) (βΛ’Λ’ π Ξ± Ο) Ξ± βΛ’Λ’-is-sup π Ξ± Ο = βΛ’Λ’-is-upperbound π Ξ± Ο , βΛ’Λ’-is-lowerbound-of-upperbounds π Ξ± Ο βΛ’Λ’-οΌ-if-continuous-and-strict : (π : DCPOβ₯ {π€} {π£}) (π : DCPOβ₯ {π€'} {π£'}) (f : βͺ π β« β βͺ π β«) β is-continuous (π β») (π β») f β is-strict π π f β {I : π₯ Μ } (Ξ± : I β βͺ π β«) β (Ο : is-prop I) β f (βΛ’Λ’ π Ξ± Ο) οΌ βΛ’Λ’ π (f β Ξ±) Ο βΛ’Λ’-οΌ-if-continuous-and-strict π π f con str Ξ± Ο = sups-are-unique (underlying-order (π β»)) (prβ (axioms-of-dcpo (π β»))) (f β Ξ±) (preserves-subsingleton-sups-if-continuous-and-strict π π f con str Ξ± Ο) (βΛ’Λ’-is-sup π (f β Ξ±) Ο) βΛ’Λ’-family-οΌ : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± Ξ² : I β βͺ π β«} (Ο : is-prop I) β Ξ± οΌ Ξ² β βΛ’Λ’ π Ξ± Ο οΌ βΛ’Λ’ π Ξ² Ο βΛ’Λ’-family-οΌ π Ο refl = refl βΛ’Λ’-οΌ-if-domain-holds : (π : DCPOβ₯ {π€} {π£}) {I : π₯ Μ } {Ξ± : I β βͺ π β«} (Ο : is-prop I) β (i : I) β βΛ’Λ’ π Ξ± Ο οΌ Ξ± i βΛ’Λ’-οΌ-if-domain-holds π {I} {Ξ±} Ο i = antisymmetry (π β») (βΛ’Λ’ π Ξ± Ο) (Ξ± i) (βΛ’Λ’-is-lowerbound-of-upperbounds π Ξ± Ο (Ξ± i) l) (βΛ’Λ’-is-upperbound π Ξ± Ο i) where l : (j : I) β Ξ± j ββͺ π β« Ξ± i l j = transport (Ξ» - β Ξ± - ββͺ π β« Ξ± i) (Ο i j) (reflexivity (π β») (Ξ± i)) \end{code}