Tom de Jong, late February - early March 2022.
Refactored slightly on 26 June 2024.
We consider sup-complete dcpos. Of course, every sup-complete poset is a dcpo,
but because the basic object of our domain-theoretic development is a dcpo, the
formalization is structured around dcpos that are additionally sup-complete.
The main point of this file is to show that we can extend families into a
sup-complete dcpo to directed families.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import MLTT.Spartan
open import UF.FunExt
open import UF.PropTrunc
module DomainTheory.Basics.SupComplete
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
(π₯ : Universe)
where
open PropositionalTruncation pt hiding (_β¨_)
open import MLTT.List
open import UF.Equiv
open import UF.EquivalenceExamples
open import DomainTheory.Basics.Dcpo pt fe π₯
open import DomainTheory.Basics.Miscelanea pt fe π₯
open import DomainTheory.Basics.WayBelow pt fe π₯
\end{code}
We first define, using a record for convenience, when a dcpo additionally has
all (small) suprema.
\begin{code}
module _
(π : DCPO {π€} {π£})
where
record is-sup-complete : π₯ βΊ β π€ β π£ Μ where
field
β : {I : π₯ Μ } (Ξ± : I β β¨ π β©) β β¨ π β©
β-is-sup : {I : π₯ Μ } (Ξ± : I β β¨ π β©) β is-sup (underlying-order π) (β Ξ±) Ξ±
β-is-upperbound : {I : π₯ Μ } (Ξ± : I β β¨ π β©)
β is-upperbound (underlying-order π) (β Ξ±) Ξ±
β-is-upperbound Ξ± = sup-is-upperbound (underlying-order π) (β-is-sup Ξ±)
β-is-lowerbound-of-upperbounds : {I : π₯ Μ } (Ξ± : I β β¨ π β©)
β is-lowerbound-of-upperbounds
(underlying-order π) (β Ξ±) Ξ±
β-is-lowerbound-of-upperbounds Ξ± =
sup-is-lowerbound-of-upperbounds (underlying-order π) (β-is-sup Ξ±)
\end{code}
In particular, we get finite joins, which we first define.
\begin{code}
module _
(π : DCPO {π€} {π£})
where
β¨-family : (x y : β¨ π β©) β π{π₯} + π{π₯} β β¨ π β©
β¨-family x y (inl _) = x
β¨-family x y (inr _) = y
record has-finite-joins : π€ β π£ β π₯ Μ where
field
β₯ : β¨ π β©
β₯-is-least : is-least (underlying-order π) β₯
_β¨_ : β¨ π β© β β¨ π β© β β¨ π β©
β¨-is-sup : (x y : β¨ π β©)
β is-sup (underlying-order π) (x β¨ y) (β¨-family x y)
infix 100 _β¨_
β¨-is-upperboundβ : {x y : β¨ π β©} β x ββ¨ π β© x β¨ y
β¨-is-upperboundβ {x} {y} = prβ (β¨-is-sup x y) (inl β)
β¨-is-upperboundβ : {x y : β¨ π β©} β y ββ¨ π β© x β¨ y
β¨-is-upperboundβ {x} {y} = prβ (β¨-is-sup x y) (inr β)
β¨-is-lowerbound-of-upperbounds : {x y z : β¨ π β©}
β x ββ¨ π β© z β y ββ¨ π β© z
β x β¨ y ββ¨ π β© z
β¨-is-lowerbound-of-upperbounds {x} {y} {z} u v = prβ (β¨-is-sup x y) z Ξ³
where
Ξ³ : is-upperbound (underlying-order π) z (β¨-family x y)
Ξ³ (inl _) = u
Ξ³ (inr _) = v
sup-complete-dcpo-has-finite-joins : (π : DCPO {π€} {π£})
β is-sup-complete π
β has-finite-joins π
sup-complete-dcpo-has-finite-joins π sc =
record { β₯ = β π-elim ;
β₯-is-least = Ξ» x β β-is-lowerbound-of-upperbounds π-elim x π-induction ;
_β¨_ = Ξ» x y β β (β¨-family π x y);
β¨-is-sup = Ξ» x y β β-is-sup (β¨-family π x y)
}
where
open is-sup-complete sc
\end{code}
The converse holds as well: if a dcpo has finite joins then it is sup-complete.
This is because, by taking finite joins, we can replace an arbitrary family by
one that is directed and which has the same supremum.
This an important separate fact that we prove now.
\begin{code}
module make-family-directed
(π : DCPO {π€} {π£})
(π-has-finite-joins : has-finite-joins π)
where
open has-finite-joins π-has-finite-joins
module _
{I : π¦ Μ }
(Ξ± : I β β¨ π β©)
where
directify : List I β β¨ π β©
directify [] = β₯
directify (x β· l) = Ξ± x β¨ directify l
directify-is-inhabited : β₯ domain directify β₯
directify-is-inhabited = β£ [] β£
++-is-upperboundβ : (l k : List I) β directify l ββ¨ π β© directify (l ++ k)
++-is-upperboundβ [] k = β₯-is-least (directify ([] ++ k))
++-is-upperboundβ (i β· l) k =
β¨-is-lowerbound-of-upperbounds β¨-is-upperboundβ
(directify l ββ¨ π β©[ ++-is-upperboundβ l k ]
directify (l ++ k) ββ¨ π β©[ β¨-is-upperboundβ ]
Ξ± i β¨ directify (l ++ k) ββ¨ π β©)
++-is-upperboundβ : (l k : List I) β directify k ββ¨ π β© directify (l ++ k)
++-is-upperboundβ [] k = reflexivity π (directify k)
++-is-upperboundβ (i β· l) k =
directify k ββ¨ π β©[ ++-is-upperboundβ l k ]
directify (l ++ k) ββ¨ π β©[ β¨-is-upperboundβ ]
Ξ± i β¨ directify (l ++ k) ββ¨ π β©
++-is-lowerbound-of-upperbounds : (l k : List I) (x : β¨ π β©)
β directify l ββ¨ π β© x
β directify k ββ¨ π β© x
β directify (l ++ k) ββ¨ π β© x
++-is-lowerbound-of-upperbounds [] k x u v = v
++-is-lowerbound-of-upperbounds (i β· l) k x u v =
β¨-is-lowerbound-of-upperbounds β¦
1β¦ β¦
2β¦
where
β¦
1β¦ = Ξ± i ββ¨ π β©[ β¨-is-upperboundβ ]
Ξ± i β¨ directify l ββ¨ π β©[ u ]
x ββ¨ π β©
β¦
2β¦ : directify (l ++ k) ββ¨ π β© x
β¦
2β¦ = ++-is-lowerbound-of-upperbounds l k x β¦
2'β¦ v
where
β¦
2'β¦ = directify l ββ¨ π β©[ β¨-is-upperboundβ ]
Ξ± i β¨ directify l ββ¨ π β©[ u ]
x ββ¨ π β©
++-is-binary-sup : (l k : List I)
β is-sup (underlying-order π) (directify (l ++ k))
(β¨-family π (directify l) (directify k))
++-is-binary-sup l k = β¦
1β¦ , β¦
2β¦
where
β¦
1β¦ : (b : π + π)
β β¨-family π (directify l) (directify k) b ββ¨ π β© directify (l ++ k)
β¦
1β¦ (inl _) = ++-is-upperboundβ l k
β¦
1β¦ (inr _) = ++-is-upperboundβ l k
β¦
2β¦ : is-lowerbound-of-upperbounds (underlying-order π)
(directify (l ++ k)) (β¨-family π (directify l) (directify k))
β¦
2β¦ x x-ub = ++-is-lowerbound-of-upperbounds l k x
(x-ub (inl β)) (x-ub (inr β))
directify-is-semidirected : is-Semidirected π directify
directify-is-semidirected l k =
β£ (l ++ k) , ++-is-upperboundβ l k , ++-is-upperboundβ l k β£
directify-is-directed : is-Directed π directify
directify-is-directed = (directify-is-inhabited , directify-is-semidirected)
directify-upperbound : (x : β¨ π β©) β is-upperbound (underlying-order π) x Ξ±
β is-upperbound (underlying-order π) x directify
directify-upperbound x x-is-ub [] = β₯-is-least x
directify-upperbound x x-is-ub (i β· l) =
β¨-is-lowerbound-of-upperbounds (x-is-ub i) (directify-upperbound x x-is-ub l)
directify-lowerbound-of-upperbounds :
(x : β¨ π β©)
β is-lowerbound-of-upperbounds (underlying-order π) x Ξ±
β is-lowerbound-of-upperbounds (underlying-order π) x directify
directify-lowerbound-of-upperbounds x x-is-lb y y-is-ub = x-is-lb y y-is-ub'
where
y-is-ub' : (i : I) β Ξ± i ββ¨ π β© y
y-is-ub' i = Ξ± i ββ¨ π β©[ β¨-is-upperboundβ ]
Ξ± i β¨ β₯ ββ¨ π β©[ reflexivity π _ ]
directify [ i ] ββ¨ π β©[ y-is-ub [ i ] ]
y ββ¨ π β©
directify-sup : (x : β¨ π β©) β is-sup (underlying-order π) x Ξ±
β is-sup (underlying-order π) x directify
directify-sup x (x-is-ub , x-is-lb-of-ubs) =
( directify-upperbound x x-is-ub
, directify-lowerbound-of-upperbounds x x-is-lb-of-ubs)
directify-sup' : (x : β¨ π β©) β is-sup (underlying-order π) x directify
β is-sup (underlying-order π) x Ξ±
directify-sup' x (x-is-ub , x-is-lb-of-ubs) =
( (Ξ» i β Ξ± i ββ¨ π β©[ β¨-is-upperboundβ ]
directify [ i ] ββ¨ π β©[ x-is-ub [ i ] ]
x ββ¨ π β©)
, (Ξ» y y-is-ub β x-is-lb-of-ubs y (directify-upperbound y y-is-ub)))
\end{code}
Moreover, if each of the Ξ±α΅’'s are compact, then so is every element in the
directified family, because taking finite joins preserves compactness.
\begin{code}
directify-is-compact : ((i : I) β is-compact π (Ξ± i))
β (l : List I) β is-compact π (directify l)
directify-is-compact Ξ±s-are-compact [] =
β₯-is-compact (π , β₯ , β₯-is-least)
directify-is-compact Ξ±s-are-compact (i β· l) =
binary-join-is-compact π β¨-is-upperboundβ β¨-is-upperboundβ
(Ξ» d β β¨-is-lowerbound-of-upperbounds) (Ξ±s-are-compact i) IH
where
IH : is-compact π (directify l)
IH = directify-is-compact Ξ±s-are-compact l
\end{code}
When constructing small compact bases for exponentials, it turns out that it is
convenient to consider a variation: we consider the family of elements Ξ±α΅’ less
than some given element x, and the corresponding family of lists l such that
directify l is less than x.
\begin{code}
module _
{x : β¨ π β©}
where
β-family : (Ξ£ i κ I , Ξ± i ββ¨ π β© x) β β¨ π β©
β-family = Ξ± β prβ
directify-β : (Ξ£ l κ List I , directify l ββ¨ π β© x) β β¨ π β©
directify-β = directify β prβ
directify-β-is-inhabited : β₯ domain directify-β β₯
directify-β-is-inhabited = β£ [] , β₯-is-least x β£
directify-β-is-semidirected : is-Semidirected π directify-β
directify-β-is-semidirected (l , l-below-x) (k , k-below-x) =
β£ ((l ++ k) , ++-is-lowerbound-of-upperbounds l k x l-below-x k-below-x)
, (++-is-upperboundβ l k) , (++-is-upperboundβ l k) β£
directify-β-is-directed : is-Directed π directify-β
directify-β-is-directed =
(directify-β-is-inhabited , directify-β-is-semidirected)
directify-β-upperbound : is-upperbound (underlying-order π) x directify-β
directify-β-upperbound = prβ
directify-β-sup : is-sup (underlying-order π) x β-family
β is-sup (underlying-order π) x directify-β
directify-β-sup (x-ub , x-lb-of-ubs) = (directify-β-upperbound , Ξ³)
where
Ξ³ : is-lowerbound-of-upperbounds (underlying-order π) x directify-β
Ξ³ y y-is-ub = x-lb-of-ubs y claim
where
claim : is-upperbound (underlying-order π) y β-family
claim (i , Ξ±α΅’-below-x) =
Ξ± i ββ¨ π β©[ β¨-is-upperboundβ ]
directify-β ([ i ] , u) ββ¨ π β©[ y-is-ub ([ i ] , u) ]
y ββ¨ π β©
where
u : Ξ± i β¨ β₯ ββ¨ π β© x
u = β¨-is-lowerbound-of-upperbounds Ξ±α΅’-below-x (β₯-is-least x)
directify-β-is-compact : ((i : I) β is-compact π (Ξ± i))
β (j : domain directify-β)
β is-compact π (directify-β j)
directify-β-is-compact Ξ±s-are-compact j =
directify-is-compact Ξ±s-are-compact (prβ j)
\end{code}
Finally if the dcpo is locally small, then the family directify-β can be indexed
by a small type (provided the original family was indexed by a small type).
\begin{code}
module _
(π-is-locally-small : is-locally-small π)
{I : π₯ Μ }
(Ξ± : I β β¨ π β©)
where
open is-locally-small π-is-locally-small
directify-β-small : (x : β¨ π β©) β (Ξ£ l κ List I , directify Ξ± l ββ x) β β¨ π β©
directify-β-small x = directify Ξ± β prβ
module _
{x : β¨ π β©}
where
directify-β-small-β : domain (directify-β Ξ±) β domain (directify-β-small x)
directify-β-small-β =
Ξ£-cong (Ξ» l β β-sym ββ-β-β)
directify-β-small-sup : is-sup (underlying-order π) x (β-family Ξ±)
β is-sup (underlying-order π) x (directify-β-small x)
directify-β-small-sup x-is-sup =
reindexed-family-sup π directify-β-small-β
(directify-β Ξ±) x (directify-β-sup Ξ± x-is-sup)
directify-β-small-is-directed : is-Directed π (directify-β-small x)
directify-β-small-is-directed =
reindexed-family-is-directed π directify-β-small-β
(directify-β Ξ±) (directify-β-is-directed Ξ±)
\end{code}
As announced, we get that dcpos with finite joins are sup-complete.
\begin{code}
dcpo-with-finite-joins-is-sup-complete : (π : DCPO {π€} {π£})
β has-finite-joins π
β is-sup-complete π
dcpo-with-finite-joins-is-sup-complete π h =
record {
β = sup ;
β-is-sup = Ξ» Ξ± β directify-sup' π h Ξ± (sup Ξ±)
(β-is-sup π (directify-is-directed π h Ξ±))
}
where
open has-finite-joins h
open make-family-directed
sup : {I : π₯ Μ } β (I β β¨ π β©) β β¨ π β©
sup {I} Ξ± = β π (directify-is-directed π h Ξ±)
\end{code}
Finally, we re-export the directify constructions via this module for use in
other files.
\begin{code}
module sup-complete-dcpo
(π : DCPO {π€} {π£'})
(π-is-sup-complete : is-sup-complete π)
where
open is-sup-complete π-is-sup-complete
open make-family-directed
π (sup-complete-dcpo-has-finite-joins π π-is-sup-complete)
public
\end{code}